/* The episode viewers (eval/, basalt/; the project page opens them as its modal, js/modal.js): a way to
   browse the evaluation results by eye, in the look of the page's survival section ("Watch Mirror mine diamonds").
   It reuses that section's own classes from css/site.css (.cinema, .segmented, .cinema-screen, .sv-*, .cinema-caption)
   and adds what the viewers need: the grid of episodes, two videos in one screen, a scrub line, and a speed pill.
   In the project page's modal (?embed, js/embed.js) html has .ev-embed: the nav and footer go, and the top right stays
   clear for the modal's round close button. */
:root { color-scheme: dark; --w-pad: max(20px, min(4vw, 56px)); }
html, body { background: var(--dark); }
html.ev-embed .localnav, html.ev-embed .footer { display: none; }
.localnav { background: rgba(15, 14, 13, .72); }
.w [hidden] { display: none !important; }
.w.cinema { padding: 0 var(--w-pad) 72px; text-align: center; }
html:not(.ev-embed) .w.cinema { padding-top: var(--nav-h); }
.w .cinema-head h1, .w .cinema-head h2 { margin: 0; font-weight: 600; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.w .cinema-head .eyebrow { margin: 0 0 10px; font-size: clamp(16px, 1.3vw, 21px); }
.w .segmented { margin: 30px auto 0; }
.w .segmented button { padding: 9px 22px; font-size: 15px; }
.w .segmented small { font-weight: 500; opacity: .6; margin-left: 6px; font-size: .9em; font-variant-numeric: tabular-nums; }
.w-note { max-width: 40em; margin: 16px auto 0; font: 500 16px/1.45 var(--sans); color: #86868b; text-wrap: balance; }
.w-note strong { font-weight: 600; color: #f5f5f7; }

/* ------------------------------------------------------------------ the list: a grid of stills */
.w-list { padding-top: clamp(56px, 9vh, 96px); }
.w-section { margin-top: 44px; text-align: left; }
/* the first grid sits close under the setting's line (the user, 10-16: the gap read as too large); BASALT's second
   grid keeps the wider gap from the first */
.w-note + .w-section, .w-note + #sections > .w-section:first-child { margin-top: 26px; }
.w-section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px 2px; }
.w-section-head h3 { margin: 0; font: 600 20px/1.2 var(--sans); letter-spacing: -.01em; color: #f5f5f7; }
.w-section-head span { font: 500 15px/1.2 var(--sans); color: #86868b; }
.w-section-note { margin: -8px 0 14px 2px; font: 500 14px/1.4 var(--sans); color: #86868b; }
.w-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 16px; }
.w-card { appearance: none; border: 0; margin: 0; padding: 0; width: 100%; background: none; color: inherit; text-align: left; cursor: pointer;
          display: flex; flex-direction: column; gap: 9px; -webkit-tap-highlight-color: transparent; }
.w-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #1d1d1f;
           box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .9); transition: transform .35s var(--ease); }
.w-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.w-thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
@media (hover: hover) { .w-card:hover .w-thumb { transform: scale(1.035); } }
.w-card:active .w-thumb { transform: scale(.98); }
.w-card:focus-visible { outline: none; }
.w-card:focus-visible .w-thumb { box-shadow: 0 0 0 3px var(--on-dark); }
/* the mark on a still: the furthest item reached, or the verdict - the survival screen's glass tag */
.w-badge { position: absolute; z-index: 1; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px;
           color: #fff; font: 700 13px/1 var(--sans); background: rgba(16, 15, 14, .52); -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4); }
.w-badge img { width: 20px; height: 20px; image-rendering: pixelated; }
.w-badge:not(:has(img)) { min-width: 26px; height: 26px; justify-content: center; padding: 0 6px; }
.w-badge.w-ok { color: #5ee08a; }
.w-badge.w-no { color: rgba(255, 255, 255, .55); }
.w-cap { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.w-cap b { font: 600 15px/1.25 var(--sans); color: #f5f5f7; letter-spacing: -.005em; }
.w-cap span { font: 500 13.5px/1.3 var(--sans); color: #86868b; }
.w-cap .w-win { color: var(--gold-dark-1); }
.w-empty { color: #86868b; }

/* ------------------------------------------------------------------ one episode */
.w-episode { text-align: center; }
html.w-ready .w-episode:not([hidden]) { animation: w-in .45s var(--ease) both; }
html.w-ready .w-list:not([hidden]) { animation: w-fade .35s var(--ease) both; }
@keyframes w-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes w-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.w-ready .w-episode:not([hidden]), html.w-ready .w-list:not([hidden]) { animation: none; } }
.w-episode:focus { outline: none; }
.w-topbar { display: flex; align-items: center; justify-content: space-between; height: 72px; margin: 0 -6px; padding-right: 54px; }
.w-back { display: inline-flex; align-items: center; gap: 2px; padding: 6px; border: 0; background: none; color: #f5f5f7; font: 600 16px/1.2 var(--sans); cursor: pointer; opacity: .8; }
.w-back svg, .w-round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .w-back:hover { opacity: 1; } }
.w-steps { display: flex; gap: 8px; }
.w-round { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #f5f5f7;
           background: rgba(255, 255, 255, .1); transition: background .2s, opacity .2s; }
@media (hover: hover) { .w-round:not(:disabled):hover { background: rgba(255, 255, 255, .18); } }
.w-round:disabled { opacity: .3; cursor: default; }
:is(.w-back, .w-round):focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; border-radius: 999px; }
.w-episode .cinema-head h2 { font-size: clamp(30px, 3.6vw, 52px); }
/* the Diamond headline's two lengths (eval/watch.js): the full sentence, and on a phone just the result */
.w-short { display: none; }
/* (site.css dims every non-gold span in a .cinema h2, for the survival headline's grey words; these wrap the whole line) */
.w .cinema-head h2 .w-long, .w .cinema-head h2 .w-short { opacity: 1; }
.w-episode .segmented { margin: 22px auto 0; }
.w-episode .segmented button { padding: 7px 18px; font-size: 14px; }

/* the player: the survival screen, with two videos in it (js/watch-player.js) */
.w-figure { margin: 26px auto 0; max-width: none; }
.w-figure .cinema-screen { --sv-room: 330px; cursor: pointer; -webkit-tap-highlight-color: transparent;
                           width: min(100%, calc((100vh - var(--sv-room)) * (var(--ar)))); }
html:not(.ev-embed) .w-figure .cinema-screen { --sv-room: 380px; }
.w-figure .sv-film { --film: 32 / 9; }
.w-video { position: absolute; top: 0; height: 100%; width: 50%; object-fit: fill; background: #000; }
.w-exec { left: 50%; }
/* the plan is the right half of the plan_idm video, below its 20 px label row (plan_box in tools/build_survival.py:
   x 320-640, y 20-211, the 16:9 view squashed to 320x191); the box stretches it back to 16:9 */
.w-plan-box { position: absolute; left: 0; top: 0; width: 50%; height: 100%; overflow: hidden; background: #000; }
.w-plan { position: absolute; left: -100%; top: calc(-20 / 191 * 100%); width: 200%; height: calc(var(--plan-h, 274) / 191 * 100%); object-fit: fill;
          max-width: none; max-height: none; }   /* (site.css caps media at the box's width) */
.w-figure .sv-pane { z-index: 1; }
.w-figure.plan-off .w-plan-box { opacity: 0; }
.w-figure.no-plan .sv-plan, .w-figure.no-plan .w-plan-box, .w-figure.no-plan .sv-toggle { display: none; }
.w-spinner { position: absolute; z-index: 2; right: 25%; top: 50%; width: 30px; height: 30px; margin: -15px -15px 0 0; border-radius: 50%; pointer-events: none;
             border: 2.5px solid rgba(255, 255, 255, .2); border-top-color: rgba(255, 255, 255, .9); animation: w-spin .8s linear infinite; opacity: 0; transition: opacity .2s; }
.w-figure.plan-off .w-spinner, .w-figure.no-plan .w-spinner { right: 50%; }
.cinema-screen.w-waiting .w-spinner { opacity: 1; transition-delay: .35s; }
@keyframes w-spin { to { transform: rotate(1turn); } }
/* the site's round video button (.vbtn, css/site.css), here a play/pause with the episode's progress on its ring */
.w-figure .vbtn { z-index: 3; }
.w-figure .vbtn .vbtn-ring { transition: stroke-dashoffset .25s linear; }

/* the scrub line under the screen: a hairline that thickens under the pointer */
.w-scrub { position: relative; height: 22px; margin-top: 4px; cursor: pointer; touch-action: none; outline: none; }
.w-rail { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: rgba(255, 255, 255, .16);
          transition: height .15s var(--ease), margin .15s var(--ease); }
.w-scrub:hover .w-rail, .w-dragging .w-rail, .w-scrub:focus-visible .w-rail { height: 7px; margin-top: -3.5px; border-radius: 4px; }
.w-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: #f5f5f7; }
.w-tick { position: absolute; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.w-tick.w-passed { background: rgba(15, 14, 13, .7); }
.w-tick.w-gold { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--gold-dark-1); }
/* a moment with an icon: the item, faded until played past (js/watch-player.js groups crowded ones) */
.w-mark { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 1; }
.w-mark img { display: block; width: 100%; height: 100%; image-rendering: pixelated; filter: grayscale(1) brightness(.42) drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 0 1px #0f0e0d);
              transition: filter .3s, transform .2s var(--ease); }   /* (opaque, so the line runs clearly behind: the user, 10-16) */
.w-mark.w-passed img { filter: drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 1px 2px rgba(0, 0, 0, .75)); }
@media (hover: hover) { .w-mark:hover img { filter: drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 0 1px #0f0e0d) drop-shadow(0 1px 2px rgba(0, 0, 0, .75)); transform: scale(1.3); } }
.w-tip { position: absolute; bottom: calc(100% + 2px); padding: 4px 8px; border-radius: 999px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
         font: 600 12.5px/1 var(--sans); font-variant-numeric: tabular-nums; color: #fff; background: rgba(16, 15, 14, .7); opacity: 0; transition: opacity .15s; }
@media (hover: hover) { .w-scrub:hover .w-tip { opacity: 1; } }
.w-figure .sv-strip { margin-top: 6px; }
.w-figure .sv-goal .sv-clock + .sv-clock { margin-left: .35em; opacity: .7; }
.w-figure .sv-milestones li { width: 28px; }
/* the speed pill on the screen, beside the round play button and in its glass: each tap moves to the next speed */
.w-figure { --vb-gap: clamp(10px, calc(var(--frame-w) * .011), 22px); --vb-size: clamp(34px, calc(var(--frame-w) * .0287), 48px); }
.w-speed { position: absolute; z-index: 3; right: calc(var(--vb-gap) + var(--vb-size) + 8px); bottom: var(--vb-gap); height: var(--vb-size);
           display: inline-flex; align-items: center; gap: .4em; padding: 0 .95em; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
           font: 600 clamp(13px, calc(var(--frame-w) * .0094), 16px)/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink);
           background: color-mix(in srgb, var(--bg-2) 78%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
           transition: transform .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.w-speed svg { height: .72em; width: auto; fill: currentColor; }
@media (hover: hover) { .w-speed:hover { transform: scale(1.04); } }
.w-speed:active { transform: scale(.96); }
.w-speed:focus-visible { outline: 2px solid var(--on-dark); outline-offset: 2px; }
.w-jump { appearance: none; border: 0; margin: 0; display: inline-flex; align-items: center; gap: .4em; padding: .5em .85em .52em .75em; border-radius: 999px;
          font: inherit; font-variant-numeric: tabular-nums; color: #f5f5f7; background: rgba(255, 255, 255, .1); cursor: pointer; white-space: nowrap; }
.w-jump-mark { font-weight: 700; }
.w-jump.w-ok .w-jump-mark { color: #5ee08a; }
.w-jump.w-no .w-jump-mark { color: rgba(255, 255, 255, .5); }
@media (hover: hover) { .w-jump:hover { background: rgba(255, 255, 255, .18); } }
:is(.w-jump, .sv-toggle):focus-visible, .w-scrub:focus-visible .w-fill { outline: 2px solid var(--on-dark); outline-offset: 2px; }
.w-figure .cinema-caption { margin: 18px 0 0 2px; max-width: none; }   /* (as wide as the video: one line where it fits, the user 10-16) */

/* ------------------------------------------------------------------ phones held upright: plan above execution */
@media (max-width: 699px) {
  :root { --w-pad: 20px; }
  .w-list { padding-top: 48px; }
  .w-long { display: none; }
  .w-short { display: inline; }
  .w-note + .w-section, .w-note + #sections > .w-section:first-child { margin-top: 20px; }
  .w .segmented { display: flex; margin-top: 24px; }
  .w .segmented button { flex: 1 1 0; padding: 8px 6px; line-height: 1.15; }
  .w .seg-sep { display: none; }
  .w .seg-sub { display: block; font-size: 12px; font-weight: 500; opacity: .75; }
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .w-cap b { font-size: 14px; }
  .w-cap span { font-size: 12.5px; }
  .w-topbar { height: 56px; padding-right: 48px; }
  .w-figure { margin: 18px calc(-1 * var(--w-pad)) 0; }
  .w-figure .cinema-screen { width: 100%; border-radius: 0; }
  .w-figure .sv-film { --film: 16 / 18; top: auto; right: auto; bottom: 0; left: 0; width: 100%; height: auto; }
  .w-figure.no-plan .sv-film { --film: 16 / 9; }
  .w-video, .w-plan-box { width: 100%; height: 50%; }
  .w-exec { left: 0; top: 50%; }
  .w-figure.no-plan .w-exec { top: 0; height: 100%; }
  .w-figure .sv-pane { width: 100%; height: 50%; }
  .w-figure .sv-exec { left: 0; top: 50%; box-shadow: inset 0 2px 0 #000; }
  .w-figure.no-plan .sv-exec { top: 0; height: 100%; }
  .w-spinner, .w-figure.plan-off .w-spinner, .w-figure.no-plan .w-spinner { right: 50%; top: 75%; }
  .w-figure.no-plan .w-spinner { top: 50%; }
  .w-scrub, .w-figure .sv-strip, .w-figure .cinema-caption { margin-left: var(--w-pad); margin-right: var(--w-pad); }
  .w-figure .sv-strip { flex-wrap: wrap; font-size: 14px; }
  /* the goal and the game clock share a row with the plan button (the user, 10-16), wrapping in their own column;
     the milestones, and BASALT's jump, go on the rows under them */
  .w-figure .sv-goal { flex: 1 1 0; min-width: 0; order: 1; white-space: normal; line-height: 1.35; }
  .w-figure .sv-goal b + .sv-clock { margin-left: .5em; }
  .w-figure .sv-goal .sv-clock { white-space: nowrap; display: inline-block; }   /* (a box of its own, so it wraps whole rather than being cut) */
  .w-figure .w-extra { order: 2; flex: none; }
  .w-figure .w-extra:empty { display: none; }
  .w-figure .sv-milestones { order: 3; flex-basis: 100%; justify-content: space-between; }
  .w-figure .sv-milestones li { width: auto; flex: 0 1 28px; }
  .w-figure .sv-toggle { order: 2; flex: none; }
  .w-figure .cinema-caption { font-size: 14px; }
}
