/* The phone, the parts its four screens share, and the caption under it.
   The screen is drawn at 390 x 844 (an iPhone's size in points) and scaled
   as one piece by --z, so every size inside .ui is a plain pixel value
   taken from the app's design. The motion is in story.css. */

.story {
  --z: 0.76;
  margin: 0;
  width: calc(410px * var(--z));
}
.phone {
  padding: calc(10px * var(--z));
  border-radius: calc(58px * var(--z));
  background: #0b0a08;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.17),
    0 34px 80px rgba(0, 0, 0, 0.55);
}
.screen {
  width: calc(390px * var(--z));
  height: calc(844px * var(--z));
  border-radius: calc(48px * var(--z));
  overflow: hidden;
  isolation: isolate;
  background: var(--stage);
}
.ui {
  position: relative;
  width: 390px;
  height: 844px;
  transform: scale(var(--z));
  transform-origin: 0 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  user-select: none;
}
:where(.ui) :where(p, ul, ol) { margin: 0; padding: 0; list-style: none; }

.status { position: absolute; inset: 0 0 auto; height: 54px; z-index: 3; }
.status b { position: absolute; left: 36px; top: 17px; font-size: 16px; font-weight: 600; }
.status svg { position: absolute; right: 30px; top: 21px; width: 46px; height: 12px; fill: currentColor; }
.pill { position: absolute; left: 50%; top: 11px; width: 112px; height: 33px; margin-left: -56px; border-radius: 999px; background: #000; }
.home { position: absolute; left: 50%; bottom: 8px; z-index: 3; width: 134px; height: 5px; margin-left: -67px; border-radius: 999px; background: rgba(247, 244, 237, 0.35); }
.scene { position: absolute; inset: 54px 0 0; }

/* ---------- Parts the screens share ---------- */
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }

/* A person's picture (drawn in the page's hidden SVG) and a row of them.
   --ring is the colour the row sits on. */
.avatar { display: block; flex: none; width: 32px; height: 32px; border-radius: 50%; }
.avatar.small { width: 24px; height: 24px; }
.faces { display: flex; padding-left: 8px; }
.faces .avatar, .more { width: 26px; height: 26px; margin-left: -8px; box-shadow: 0 0 0 2px var(--ring, var(--stage)); }
.more {
  display: grid; place-items: center;
  border-radius: 50%; background: var(--chip); color: var(--ink-soft);
  font: 700 10px/1 "Spline Sans Mono", ui-monospace, monospace;
}

.ui .emblem { width: 22px; height: 22px; border-radius: 6px; padding: 4.5px; }
.solve-time {
  font: 700 15px/1 "Spline Sans Mono", ui-monospace, monospace;
  padding: 5px 9px 4px;
  border-radius: 7px;
  background: var(--tile);
  color: var(--stamp);
}
.lap { font: 700 15px/1 "Spline Sans Mono", ui-monospace, monospace; color: var(--ink-soft); }
.stars { display: inline-flex; gap: 4px; }
.stars svg { width: 17px; height: 17px; fill: var(--gold); }
.stars svg.off { fill: var(--star-off); }

.group { display: flex; align-items: center; gap: 12px; padding: 8px 18px 0; }
.group .back { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.group-mark { display: block; flex: none; width: 44px; height: 44px; border-radius: 12px; }
.group .faces { margin-left: auto; }
.group-name { font-size: 20px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.group .label { color: var(--ink-faint); }
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 14px 16px 0; padding: 4px;
  border-radius: 12px; background: var(--ground);
  text-align: center; color: var(--ink-soft);
}
.tabs span { position: relative; padding: 8px 0 7px; border-radius: 9px; }
.tabs .on { background: var(--chip); color: var(--ink); }

/* Two things that take turns in one place (11 becomes 12): the first is
   only there while the loop runs. */
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; }
.was { opacity: 0; }
/* A finger's tap, shown just before the screen changes. */
.tap {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(247, 244, 237, 0.3);
  opacity: 0;
}
/* Confetti, thrown from the crown on the leaderboard. This is the point
   it starts from; build.py keeps every piece inside the screen. */
.fx { position: absolute; left: 195px; top: 266px; z-index: 4; }
.fx i { position: absolute; left: -4px; top: -7px; width: 8px; height: 14px; border-radius: 2px; background: var(--c); opacity: 0; }
.fx .dot { top: -4px; height: 8px; border-radius: 50%; }

/* ---------- Under the phone ----------
   Without motion the four beats are a plain list.
   story.css turns them into one line that changes with the screen. */
.story figcaption { margin-top: 20px; }
.progress { display: none; }
.beats { margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--ink-soft); }
.beats li + li { margin-top: 0.3em; }

@media (min-width: 960px) and (min-height: 980px) { .story { --z: 0.86; } }
@media (min-width: 960px) and (max-height: 790px) { .story { --z: 0.66; } }
@media (max-width: 959px) { .story { --z: 0.8; margin-inline: auto; } }
@media (max-width: 370px) { .story { --z: 0.68; } }
