/* Plex Wrapped — the year as full-screen stories, built to be screenshotted
   straight into a phone story. The look follows the 2026 streaming Wrapped:
   a near-black base, thermal "topographic" blobs, one ink colour per story
   (salmon, lavender, lime), and a very wide, very heavy grotesk. The Plex
   half is the amber, which only ever appears on Plex's own moments: the
   cover, the live story and the summary card.

   Archivo is vendored (SIL OFL, vendor/archivo/OFL.txt). Its width axis does
   both voices: 125 for the extended headlines, 62 for the condensed logo and
   trading-card names. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo/Archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo/Archivo-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #ff8b7b;
  --ink-dim: rgba(255, 139, 123, 0.78);
  --bg: #1d1412;
  --amber: #e5a00d;
  --paper: #fff;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --frame-w: min(100vw, calc(100dvh * 9 / 16));
  --u: calc(var(--frame-w) / 100);  /* one hundredth of the frame's width */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* A phone held upright is the frame: fill it, as the app does. The 9:16
   frame is for wider screens, where the card floats. */
@media (max-aspect-ratio: 10/16) {
  :root { --frame-w: 100vw; }
  .wr-stage { height: 100dvh; aspect-ratio: auto; }
}
html, body {
  margin: 0; height: 100%; background: #0b0b0b; color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
/* Fixed, so focusing a button (the age guess) can never scroll the frame. */
body { display: grid; place-items: center; position: fixed; inset: 0; overscroll-behavior: none; }

.wr-stage {
  position: relative; width: var(--frame-w); aspect-ratio: 9 / 16;
  max-height: 100dvh; overflow: hidden; background: var(--bg);
  /* `hidden` is still scrollable by focus and by the canvas's bleed; `clip`
     is not, which kept the top bar from sliding up out of the frame. */
  overflow: clip;
  transition: background-color 0.6s var(--ease);
  isolation: isolate;
}
@media (min-aspect-ratio: 10/16) {
  .wr-stage { border-radius: calc(var(--u) * 5); box-shadow: 0 30px 120px rgba(0,0,0,.6); }
}

.wr-bg {
  position: absolute; inset: -6%; width: 112%; height: 112%;
  filter: blur(calc(var(--u) * 1.6)) saturate(1.15);
  image-rendering: auto; z-index: 0;
}
/* Film grain: the streaming visuals are never clean gradients. */
.wr-grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -0.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wr-stories { position: absolute; inset: 0; z-index: 2; }
.wr-story {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--u) * 20) calc(var(--u) * 8) calc(var(--u) * 26);
  opacity: 0; transform: translateY(6%); pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
}
.wr-story.is-on { opacity: 1; transform: none; pointer-events: auto; }
.wr-story.is-past { transform: translateY(-6%); }
@media (prefers-reduced-motion: reduce) {
  .wr-story, .wr-story.is-past { transform: none; transition: opacity 0.2s linear; }
}

/* ---------- type ---------- */
.h1, .h2, .h3, .big, .kicker, .p, .tiny { margin: 0; }
.kicker {
  font-stretch: 120%; font-weight: 700; font-size: calc(var(--u) * 3.6);
  color: var(--ink-dim); letter-spacing: 0.005em;
}
.h1 {
  font-stretch: 125%; font-weight: 800; font-size: calc(var(--u) * 7.4);
  line-height: 1.02; letter-spacing: -0.012em; color: var(--ink);
  text-wrap: balance;
}
.h2 {
  font-stretch: 125%; font-weight: 800; font-size: calc(var(--u) * 5.6);
  line-height: 1.05; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance;
}
.h3 {
  font-stretch: 125%; font-weight: 800; font-size: calc(var(--u) * 4.2);
  line-height: 1.1; color: var(--ink); text-wrap: balance;
}
.big {
  font-stretch: 125%; font-weight: 900; color: var(--ink);
  font-size: calc(var(--u) * 30); line-height: 0.9; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.big.mid { font-size: calc(var(--u) * 15); }
.p {
  font-stretch: 112%; font-weight: 500; font-size: calc(var(--u) * 3.3);
  line-height: 1.35; color: var(--ink-dim); text-wrap: balance;
}
.p b, .h2 b { color: var(--ink); font-weight: 800; }
.tiny { font-stretch: 110%; font-weight: 600; font-size: calc(var(--u) * 2.6); color: var(--ink-dim); }
.gap-s { height: calc(var(--u) * 2.4); flex: none; }
.gap-m { height: calc(var(--u) * 5); flex: none; }
.gap-l { height: calc(var(--u) * 9); flex: none; }

/* ---------- chrome ---------- */
.wr-top, .wr-bottom {
  position: absolute; left: 0; right: 0; z-index: 5; display: flex;
  align-items: center; justify-content: space-between;
  padding: calc(var(--u) * 4.4) calc(var(--u) * 4.4);
  transition: opacity 0.25s linear;
}
.wr-top { top: 0; padding-top: max(calc(var(--u) * 4.4), env(safe-area-inset-top)); }
.wr-bottom { bottom: 0; align-items: flex-end;
  padding-bottom: max(calc(var(--u) * 5), env(safe-area-inset-bottom)); }
.wr-icon {
  width: calc(var(--u) * 8.6); height: calc(var(--u) * 8.6); border-radius: 50%;
  display: grid; place-items: center; border: 0; padding: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.28); color: #fff; -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.wr-icon svg { width: 56%; height: 56%; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wr-center { display: flex; justify-content: center; min-width: 0; flex: 1; padding: 0 calc(var(--u) * 3); }
.wr-pill {
  display: inline-flex; align-items: center; gap: calc(var(--u) * 1.4);
  max-width: 100%; padding: calc(var(--u) * 1.4) calc(var(--u) * 3);
  border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: #fff;
  font-stretch: 105%; font-weight: 700; font-size: calc(var(--u) * 2.5);
  white-space: nowrap; overflow: hidden; -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.wr-pill span { overflow: hidden; text-overflow: ellipsis; }
.wr-pill i { font-style: normal; opacity: 0.7; font-weight: 500; }
.wr-pill .eq { display: inline-flex; gap: 1.5px; align-items: flex-end; height: 1em; flex: none; }
.wr-pill .eq b { width: 2px; background: currentColor; animation: eq 0.9s ease-in-out infinite; }
.wr-pill .eq b:nth-child(1) { height: 40%; }
.wr-pill .eq b:nth-child(2) { height: 100%; animation-delay: -0.3s; }
.wr-pill .eq b:nth-child(3) { height: 65%; animation-delay: -0.6s; }
@keyframes eq { 50% { transform: scaleY(0.4); } }
.wr-pill .eq b { transform-origin: bottom; }

/* The mark: Plex's chevron in its amber, where the other one has a circle. */
.plex-mark { width: calc(var(--u) * 8.6); height: calc(var(--u) * 8.6); display: block; }

.wr-next { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1);
  font-size: calc(var(--u) * 2.2); font-weight: 600; color: #fff; }
.wr-next span { background: rgba(0,0,0,.35); border-radius: 4px; padding: 1px 5px; }
.wr-share {
  border: 0; border-radius: 999px; background: #fff; color: #111; cursor: pointer;
  font-family: inherit; font-stretch: 105%; font-weight: 700;
  font-size: calc(var(--u) * 3.1); padding: calc(var(--u) * 2.6) calc(var(--u) * 5.4);
}
.wr-receipts {
  width: calc(var(--u) * 8.6); height: calc(var(--u) * 8.6); border-radius: 50%;
  border: 0; background: #fff; color: #111; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; justify-content: center; line-height: 0.95;
  font-family: inherit; font-stretch: 125%; font-weight: 900; font-size: calc(var(--u) * 2.1);
}
.wr-receipts span:last-child { font-size: calc(var(--u) * 3.1); }
.wr-bottom .wr-spacer { width: calc(var(--u) * 8.6); }

/* Share mode: just the card, for a clean screenshot. */
.wr-stage.is-sharing .wr-top, .wr-stage.is-sharing .wr-bottom { opacity: 0; pointer-events: none; }
.wr-sharehint {
  position: absolute; z-index: 6; left: 50%; bottom: calc(var(--u) * 4);
  transform: translateX(-50%); white-space: nowrap;
  background: rgba(0,0,0,.6); color: #fff; border-radius: 999px;
  font-size: calc(var(--u) * 2.6); font-weight: 600; padding: 6px 12px;
  animation: hint 3.2s forwards;
}
@keyframes hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.wr-stamp {
  position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 6); display: none;
  align-items: center; justify-content: center; gap: calc(var(--u) * 1.6);
  font-stretch: 62%; font-style: italic; font-weight: 900; color: #fff;
  font-size: calc(var(--u) * 3.6); letter-spacing: 0.02em;
}
.wr-stamp .plex-mark { width: calc(var(--u) * 5); height: calc(var(--u) * 5); }
.wr-stage.is-sharing .wr-story.is-on .wr-stamp { display: flex; }

/* ---------- art ---------- */
.art {
  position: relative; display: block; overflow: hidden; background: rgba(255,255,255,.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.45); flex: none;
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-stretch: 62%; font-weight: 900; font-size: 2.2em; color: var(--ink);
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 60%);
}
.art.round { border-radius: 50%; }
.art-l { width: calc(var(--u) * 58); height: calc(var(--u) * 58); }
.art-m { width: calc(var(--u) * 40); height: calc(var(--u) * 40); }
.art-s { width: calc(var(--u) * 13); height: calc(var(--u) * 13); }

.bleed { position: absolute; inset: 0; z-index: -1; }
.bleed .art { position: absolute; inset: 0; width: 100%; height: 100%; box-shadow: none; }
.bleed .art img { filter: saturate(1.1); }
.bleed::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.75) 75%, rgba(0,0,0,.92) 100%); }
.story-bleed { justify-content: flex-end; }

/* ---------- lists ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; }
.rank-list li {
  display: flex; align-items: center; gap: calc(var(--u) * 3);
  padding: calc(var(--u) * 1.3) 0;
}
.rank-list .n { width: calc(var(--u) * 4); font-weight: 600; font-size: calc(var(--u) * 3);
  color: var(--ink-dim); text-align: center; flex: none; }
.rank-list .t { min-width: 0; flex: 1; }
.rank-list .t b { display: block; font-stretch: 125%; font-weight: 800; font-size: calc(var(--u) * 3.6);
  color: var(--ink); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .t i { display: block; font-style: normal; font-weight: 500; font-size: calc(var(--u) * 2.7);
  color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.genre-list li { border-top: 1px solid var(--ink-dim); padding: calc(var(--u) * 3) 0; cursor: pointer; }
.genre-list li:last-child { border-bottom: 1px solid var(--ink-dim); }
.genre-list .t b { font-size: calc(var(--u) * 5); white-space: normal; }
.genre-list li.on .t b { color: #fff; }
.genre-list .play { width: 0; height: 0; border-left: calc(var(--u) * 2.4) solid var(--ink);
  border-top: calc(var(--u) * 1.5) solid transparent; border-bottom: calc(var(--u) * 1.5) solid transparent; flex: none; }
.genre-list li.on .play { border-left-color: #fff; }

/* ---------- collage / crate ---------- */
.collage { position: relative; width: calc(var(--u) * 74); height: calc(var(--u) * 52); flex: none; }
.collage .art { position: absolute; width: calc(var(--u) * 30); height: calc(var(--u) * 30); }
.collage .art:nth-child(1) { left: 2%; top: 4%; transform: rotate(-4deg); z-index: 3; }
.collage .art:nth-child(2) { left: 36%; top: 0; transform: rotate(3deg); z-index: 2; width: calc(var(--u) * 26); height: calc(var(--u) * 26); }
.collage .art:nth-child(3) { left: 14%; top: 44%; transform: rotate(2deg); z-index: 4; width: calc(var(--u) * 24); height: calc(var(--u) * 24); }
.collage .art:nth-child(4) { left: 46%; top: 40%; transform: rotate(-3deg); z-index: 5; width: calc(var(--u) * 26); height: calc(var(--u) * 26); }
.collage .art:nth-child(5) { left: 68%; top: 18%; transform: rotate(5deg); z-index: 1; width: calc(var(--u) * 22); height: calc(var(--u) * 22); }

.crate { position: relative; width: calc(var(--u) * 56); height: calc(var(--u) * 56); flex: none; perspective: 900px; }
.crate .art { position: absolute; inset: 0; width: 100%; height: 100%;
  transition: transform 0.7s var(--ease), opacity 0.5s linear; }
.crate .is-gone { transform: translateX(-130%) rotate(-14deg); opacity: 0; }
.crate-sleeve { transition: transform 0.7s var(--ease), opacity 0.5s linear; z-index: 1; }
.crate .art.is-back { transform: translateY(-4%) scale(0.94); filter: brightness(0.6); }
.crate-sleeve {
  position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
  background: repeating-radial-gradient(circle at 50% 50%, #241c5a 0 3%, #17122f 3% 6%);
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.crate-sleeve span { font-stretch: 62%; font-style: italic; font-weight: 900;
  font-size: calc(var(--u) * 12); color: var(--ink); }

/* ---------- trading cards ---------- */
.pack, .tcard {
  position: relative; width: calc(var(--u) * 60); height: calc(var(--u) * 84); flex: none;
  border-radius: calc(var(--u) * 3); overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.pack {
  background: linear-gradient(125deg, #c9f3ff 0%, #f6c6ff 22%, #b5ffe1 44%, #fff2b8 62%, #c4c8ff 82%, #9fe9ff 100%);
  background-size: 220% 220%; animation: foil 6s ease-in-out infinite alternate;
  color: #111; text-align: left; padding: calc(var(--u) * 6) calc(var(--u) * 5);
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
}
@keyframes foil { to { background-position: 100% 100%; } }
.pack .pack-title { font-stretch: 62%; font-weight: 900; font-size: calc(var(--u) * 13.5);
  line-height: 0.88; letter-spacing: -0.01em; margin: 0; }
.pack .pack-foot { display: flex; justify-content: space-between; font-weight: 800;
  font-size: calc(var(--u) * 2.4); letter-spacing: 0.06em; }
.pack .pack-title { max-width: 80%; }
.pack .pack-side { position: absolute; right: calc(var(--u) * 3); top: calc(var(--u) * 6);
  writing-mode: vertical-rl;
  font-stretch: 62%; font-style: italic; font-weight: 900; font-size: calc(var(--u) * 5);
  white-space: nowrap; }
.pack.is-open { animation: tear 0.6s var(--ease) forwards; }
@keyframes tear { to { transform: translateY(-120%) rotate(-8deg); opacity: 0; } }

/* The flip is a squash, not a 3D turn: a rounded, clipped card flattens any
   preserve-3d child, and WebKit then shows the front mirrored. */
.tcard { background: #0e0c1d; border: calc(var(--u) * 0.6) solid #000; cursor: pointer; }
.tcard.is-flipping { animation: flip 0.5s var(--ease); }
@keyframes flip { 50% { transform: scaleX(0.02); } }
.tcard .face { position: absolute; inset: 0;
  display: flex; flex-direction: column; padding: calc(var(--u) * 4); text-align: left; }
.tcard .back { display: none; justify-content: center; gap: calc(var(--u) * 3);
  background: linear-gradient(160deg, #241c5a, #0e0c1d); padding-right: calc(var(--u) * 10); }
.tcard.is-flipped .back { display: flex; }
.tcard.is-flipped .front { display: none; }
.tcard .photo { width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.tcard .photo .art { width: 100%; height: 100%; box-shadow: none; }
.tcard .name { font-stretch: 62%; font-weight: 900; font-size: calc(var(--u) * 9.5); line-height: 0.95;
  text-transform: uppercase; color: #fff; margin: calc(var(--u) * 3) 0 calc(var(--u) * 2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .stats { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 1) calc(var(--u) * 3);
  border-top: 1px solid rgba(255,255,255,.3); padding-top: calc(var(--u) * 2); }
.tcard .stat i { display: block; font-style: normal; font-weight: 800; font-size: calc(var(--u) * 1.9);
  letter-spacing: 0.08em; color: rgba(255,255,255,.65); }
.tcard .stat b { font-stretch: 100%; font-weight: 700; font-size: calc(var(--u) * 4.4); color: #fff; }
.tcard .rail { position: absolute; right: 0; top: 0; bottom: 0; width: calc(var(--u) * 7);
  background: linear-gradient(180deg, #8f88ff, #e6d87a); display: flex; align-items: center;
  justify-content: center; }
.tcard .rail span { writing-mode: vertical-rl; white-space: nowrap; font-stretch: 62%; font-style: italic;
  font-weight: 900; font-size: calc(var(--u) * 3.6); color: #111; }
.tcard .face.front { padding-right: calc(var(--u) * 10); }
.tcard.is-top { background: linear-gradient(160deg, #6c5cff 0%, #2a1f7a 60%, #0e0c1d 100%); }
.sparkle { position: absolute; color: #fff; font-size: calc(var(--u) * 5); pointer-events: none;
  animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: 0.15; transform: scale(0.6); } }

/* ---------- listening age ---------- */
.choices { display: flex; flex-direction: column; gap: calc(var(--u) * 2.2); width: 78%; }
.choice {
  border: 1.5px solid var(--ink); border-radius: 999px; background: rgba(0,0,0,.25);
  color: var(--ink); font-family: inherit; font-stretch: 112%; font-weight: 700;
  font-size: calc(var(--u) * 3.3); padding: calc(var(--u) * 2.4); cursor: pointer;
}
.choice:active { background: var(--ink); color: #111; }

/* ---------- sound status ---------- */
.status-art { width: calc(var(--u) * 56); height: calc(var(--u) * 56); flex: none; }
.status-art svg { width: 100%; height: 100%; overflow: visible; }
.status-art .stroke { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.status-art .fill { fill: var(--ink); }
.status-art .beat { animation: beat 1.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes beat { 15% { transform: scale(1.12); } 30% { transform: scale(1); } }

/* ---------- live ---------- */
.posters { position: relative; width: calc(var(--u) * 76); height: calc(var(--u) * 58); flex: none; }
.posters .art { position: absolute; width: calc(var(--u) * 28); height: calc(var(--u) * 40); border-radius: 4px; }
.posters .art img { object-fit: cover; }
.live-stats { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 3) calc(var(--u) * 5); justify-content: center; }
.live-stats div { display: flex; flex-direction: column; align-items: center; }
.live-stats b { font-stretch: 125%; font-weight: 900; font-size: calc(var(--u) * 10); color: var(--ink); line-height: 1; }
.live-stats i { font-style: normal; font-weight: 700; font-size: calc(var(--u) * 2.7); color: var(--ink-dim); }

/* ---------- time machine ---------- */
.years { display: flex; gap: calc(var(--u) * 1.6); flex-wrap: wrap; justify-content: center; }
.years span { border-radius: 999px; padding: calc(var(--u) * 0.8) calc(var(--u) * 2.4);
  background: rgba(0,0,0,.4); color: #fff; font-weight: 800; font-size: calc(var(--u) * 2.5); }
.years span.on { background: var(--ink); color: #111; }

/* ---------- cover + summary ---------- */
.logo {
  font-stretch: 62%; font-style: italic; font-weight: 900; color: #fff; line-height: 0.82;
  letter-spacing: -0.01em; text-transform: uppercase;
  -webkit-text-stroke: calc(var(--u) * 0.5) #000; paint-order: stroke fill;
}
.logo .yr { font-size: calc(var(--u) * 26); display: block; }
.logo .wd { font-size: calc(var(--u) * 21); display: block; }
.logo .px { color: var(--amber); }
.cover-sub { font-stretch: 120%; font-weight: 800; font-size: calc(var(--u) * 4); color: #fff; }

.summary { width: 100%; text-align: left; display: flex; flex-direction: column; gap: calc(var(--u) * 4); }
.summary-head { display: flex; justify-content: center; }
.summary-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: calc(var(--u) * 4); }
.summary-head .art { width: calc(var(--u) * 50); height: calc(var(--u) * 50); }
.wr-stage.is-sharing .wr-story.no-stamp .wr-stamp { display: none; }
.summary h4 { margin: 0 0 calc(var(--u) * 1.2); font-weight: 600; font-stretch: 110%;
  font-size: calc(var(--u) * 2.8); color: var(--ink-dim); }
.summary ol { margin: 0; padding: 0; list-style: none; }
.summary li { font-stretch: 112%; font-weight: 800; font-size: calc(var(--u) * 3.1); color: #fff;
  line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary li span { color: var(--ink-dim); font-weight: 600; margin-right: calc(var(--u) * 1.4); }
.summary .stat-big { font-stretch: 125%; font-weight: 900; font-size: calc(var(--u) * 7); color: #fff; line-height: 1; }
.summary-foot { display: flex; align-items: center; gap: calc(var(--u) * 1.6);
  font-stretch: 62%; font-style: italic; font-weight: 900; font-size: calc(var(--u) * 4); color: #fff; }

/* ---------- receipts sheet ---------- */
.wr-sheet {
  position: absolute; inset: auto 0 0 0; z-index: 8; max-height: 82%; overflow-y: auto;
  background: #181818; color: #fff; border-radius: calc(var(--u) * 5) calc(var(--u) * 5) 0 0;
  padding: calc(var(--u) * 3) calc(var(--u) * 5) calc(var(--u) * 8);
  animation: sheet 0.4s var(--ease); -webkit-user-select: text; user-select: text;
}
@keyframes sheet { from { transform: translateY(100%); } }
.wr-sheet .grab { width: calc(var(--u) * 10); height: 4px; border-radius: 2px; background: #555; margin: 0 auto calc(var(--u) * 3); }
.wr-sheet h3 { margin: 0; text-align: center; font-stretch: 125%; font-weight: 900; font-size: calc(var(--u) * 6); color: var(--ink); }
.wr-sheet .range { text-align: center; color: var(--ink); font-weight: 600; font-size: calc(var(--u) * 3); }
.wr-sheet .how { text-align: center; color: #bbb; font-size: calc(var(--u) * 2.8); line-height: 1.4; margin: calc(var(--u) * 3) 0; }
.wr-sheet table { width: 100%; border-collapse: collapse; font-size: calc(var(--u) * 3); }
.wr-sheet th { text-align: left; color: #999; font-weight: 500; font-size: calc(var(--u) * 2.5); padding: 6px 0; }
.wr-sheet th:last-child, .wr-sheet td.v { text-align: right; }
.wr-sheet td { padding: calc(var(--u) * 1.8) 0; border-top: 1px solid #2a2a2a; vertical-align: middle; }
.wr-sheet td.r { width: 8%; color: #999; }
.wr-sheet td i { display: block; font-style: normal; color: #999; font-size: calc(var(--u) * 2.5); }
.wr-sheet tr.months td { border-top: 0; padding-top: 0; }
.bars { display: flex; align-items: flex-end; gap: 4%; height: calc(var(--u) * 16); padding: 0 2%; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars span { width: 100%; border-radius: 999px; background: var(--ink); min-height: 4px; opacity: 0.45; }
.bars div.peak span { opacity: 1; }
.bars em { font-style: normal; font-size: calc(var(--u) * 2); color: #999; margin-top: 3px; }

.wr-loading, .wr-error { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
  font-stretch: 120%; font-weight: 800; font-size: calc(var(--u) * 4.4); color: var(--ink); padding: 10%; text-align: center; }

/* ---------- the screen chapter ---------- */
/* Film and show posters are 2:3, not square like a sleeve. */
.art-poster { width: calc(var(--u) * 40); height: calc(var(--u) * 60); border-radius: 6px; }
.summary-head .art.art-poster { width: calc(var(--u) * 33); height: calc(var(--u) * 50); }
.art-s.art-tall { height: calc(var(--u) * 19); border-radius: 3px; }
.split { display: flex; width: 100%; height: calc(var(--u) * 4); border-radius: 999px; overflow: hidden; gap: 2px; }
.split span { flex: 1 1 0; min-width: 4px; }
.split-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(var(--u) * 1.4) calc(var(--u) * 3.4);
  margin-top: calc(var(--u) * 2.4); font-weight: 700; font-size: calc(var(--u) * 2.6); color: #fff; }
.split-legend span { display: inline-flex; align-items: center; gap: calc(var(--u) * 1.2); }
.split-legend i { width: calc(var(--u) * 2.4); height: calc(var(--u) * 2.4); border-radius: 50%; }
.split .s0, .split-legend .s0 { background: var(--ink); }
.split .s1, .split-legend .s1 { background: #fff; }
.split .s2, .split-legend .s2 { background: #e5a00d; }
.split .s3, .split-legend .s3 { background: #8d86ff; }
.habits { width: 100%; display: flex; flex-direction: column; text-align: left; }
.habits div { display: flex; justify-content: space-between; align-items: baseline; gap: calc(var(--u) * 3);
  border-top: 1px solid var(--ink-dim); padding: calc(var(--u) * 2.8) 0; }
.habits div:last-child { border-bottom: 1px solid var(--ink-dim); }
.habits i { font-style: normal; font-weight: 600; font-size: calc(var(--u) * 2.8); color: var(--ink-dim); flex: none; }
.habits b { font-stretch: 120%; font-weight: 800; font-size: calc(var(--u) * 3.6); color: #fff; text-align: right;
  min-width: 0; overflow-wrap: anywhere; }
.years.cities span { font-size: calc(var(--u) * 3); }
.poster-row { display: flex; justify-content: center; }
.poster-row .art-poster { width: calc(var(--u) * 26); height: calc(var(--u) * 39); }
.poster-row .art-poster + .art-poster { margin-left: calc(var(--u) * -4); }
.poster-row .art-poster:nth-child(1) { transform: rotate(-6deg); }
.poster-row .art-poster:nth-child(2) { transform: translateY(calc(var(--u) * -2)); z-index: 1; }
.poster-row .art-poster:nth-child(3) { transform: rotate(6deg); }

/* ---------- the Wrapped app's additions ---------- */
.wr-spacer { visibility: hidden; }
.poster-row.duo .art-poster:nth-child(2) { transform: rotate(5deg); border-radius: 4px; }
.habits.seasons b { font-size: calc(var(--u) * 3.1); }

/* ---------- the app around the stories: sign-in, your years, privacy ---------- */
/* The back button keeps its slot (invisible), so the Plex mark stays centred in the header. */
.wr-stage.is-screen .wr-bottom { display: none; }
.wr-stage.is-screen #wr-back { visibility: hidden; pointer-events: none; }
.wr-screen { justify-content: center; gap: 0; overflow-y: auto; }
.wr-cta {
  appearance: none; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--amber); color: #1a1408; font: inherit; font-stretch: 112%; font-weight: 800;
  font-size: calc(var(--u) * 4.2); padding: calc(var(--u) * 3.6) calc(var(--u) * 9);
  box-shadow: 0 12px 40px rgba(229,160,13,.35); transition: transform .15s var(--ease), opacity .2s;
}
.wr-cta:active { transform: scale(.97); }
.wr-cta:disabled { opacity: .7; cursor: default; }
.wr-cta.ghost { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; font-size: calc(var(--u) * 3.2);
  padding: calc(var(--u) * 2.4) calc(var(--u) * 5); }
.fixture-row { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 2); justify-content: center; margin-top: calc(var(--u) * 4); }
.wr-foot-link { margin-top: calc(var(--u) * 6); background: none; border: 0; font: inherit; cursor: pointer;
  color: var(--ink-dim); font-weight: 600; font-size: calc(var(--u) * 2.8); text-decoration: underline; text-underline-offset: 3px; }
.foot-row { display: flex; gap: calc(var(--u) * 6); justify-content: center; }
.foot-row .wr-foot-link { margin-top: 0; }
.year-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--u) * 3); width: 100%; }
.year-tile {
  display: flex; flex-direction: column; justify-content: space-between; text-align: left; text-decoration: none;
  min-height: calc(var(--u) * 26); padding: calc(var(--u) * 3.6); border-radius: calc(var(--u) * 4);
  background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.year-tile i { font-style: normal; font-weight: 700; font-size: calc(var(--u) * 2.6); color: var(--ink-dim); }
.year-tile b { font-stretch: 125%; font-weight: 900; font-size: calc(var(--u) * 10); line-height: 1; }
.year-tile.is-now { grid-column: 1 / -1; background: var(--amber); color: #1a1408; box-shadow: 0 14px 50px rgba(229,160,13,.35); }
.year-tile.is-now i { color: rgba(26,20,8,.7); }
.year-tile.is-now b { font-size: calc(var(--u) * 16); }
.screen-privacy .p { text-align: left; }

/* ---------- the album card, the film wall, the share button's second tap ---------- */
.cover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 1.6); }
.cover-grid .art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 4px; }
.summary li { white-space: nowrap; }
.film-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 1.8); width: 86%; }
.film-wall .art-poster { width: 100%; height: auto; aspect-ratio: 2 / 3; }
.wr-share.is-ready { background: var(--amber); color: #1a1408; }

/* ---------- your years of going out ---------- */
.live-years i { display: flex; align-items: center; gap: calc(var(--u) * 2); flex: 1; min-width: 0; }
.live-years em { font-style: normal; font-weight: 800; color: #fff; width: calc(var(--u) * 9); flex: none; }
.live-years .yr-bar { height: calc(var(--u) * 1.6); border-radius: 999px; background: var(--ink); display: block; }
.live-years b { font-size: calc(var(--u) * 2.8); flex: none; max-width: 62%; }
.live-years div { padding: calc(var(--u) * 1.8) 0; }

/* ---------- your years of going out ---------- */
.live-years i { display: flex; align-items: center; gap: calc(var(--u) * 2); flex: 1; min-width: 0; }
.live-years em { font-style: normal; font-weight: 800; color: #fff; width: calc(var(--u) * 9); flex: none; }
.live-years .yr-bar { height: calc(var(--u) * 1.6); border-radius: 999px; background: var(--ink); display: block; }
.live-years b { font-size: calc(var(--u) * 2.8); flex: none; max-width: 62%; }
.live-years div { padding: calc(var(--u) * 1.8) 0; }

/* ---------- the five-album card: #1 large, #2-#5 in a 2x2 beside it ---------- */
.cover-grid.top5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: calc(var(--u) * 1.8); }
.cover-grid.top5 .art:first-child { grid-row: 1 / 3; }
.cover-grid.top5 .art { width: 100%; height: auto; aspect-ratio: 1; }


/* No stamp on the stories, on screen or shared: the summary cards carry their own Plex Wrapped
   footer, centred at the bottom, and only those cards. */
.wr-stamp, .wr-stage.is-sharing .wr-story.is-on .wr-stamp { display: none !important; }
.summary-foot { justify-content: center; }
/* The screen's minutes sit a little lower, clear of the header. */
.wr-story.story-low { padding-top: calc(var(--u) * 32); }

/* ---------- the share preview: the picture, a Share button, press-and-hold to save ---------- */
.share-preview {
  position: absolute; inset: 0; z-index: 20; background: rgba(0,0,0,.86);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(var(--u) * 4); padding: calc(var(--u) * 14) calc(var(--u) * 8);
  -webkit-user-select: auto; user-select: auto;
}
.share-preview img { max-height: 68%; max-width: 100%; border-radius: calc(var(--u) * 3);
  box-shadow: 0 20px 60px rgba(0,0,0,.6); -webkit-touch-callout: default; }
.share-preview .tiny { color: rgba(255,255,255,.7); }
.share-preview .preview-close { position: absolute; top: calc(var(--u) * 4); right: calc(var(--u) * 4);
  font-size: calc(var(--u) * 6); color: #fff; background: rgba(255,255,255,.12); }

/* Ten rows of the all-time top 10 fit on one card. */
.rank-list.compact li { padding: calc(var(--u) * 0.9) 0; }
.rank-list.compact .art-s { width: calc(var(--u) * 9); height: calc(var(--u) * 9); }
.rank-list.compact .t b { font-size: calc(var(--u) * 3.1); }
.rank-list.compact .t i { font-size: calc(var(--u) * 2.3); }

/* ---------- round 5 ---------- */
/* The screens around the stories (your years, privacy) carry no Plex mark in the header: on the years
   page it sat on top of "Hi, <name>". The years list starts lower, clear of the header. */
.wr-stage.is-screen .wr-center { visibility: hidden; }
.wr-screen.screen-years { justify-content: flex-start; padding-top: calc(var(--u) * 30); }
/* Until Archivo has loaded, the stories wait: drawn in the fallback face, the condensed and extended
   headlines came up a size too big for a second, then snapped down. Lifted by the script when the
   fonts are in, or after 1.5s whatever happens. */
.wr-stage.fonts-wait .wr-stories, .wr-stage.fonts-wait .wr-screen { visibility: hidden; }
/* The stamp on the three summary cards: small, near the bottom edge, where the share picture keeps it. */
.summary-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--u) * 7);
  justify-content: center; font-size: calc(var(--u) * 3.2); gap: calc(var(--u) * 1.4); }
.summary-foot .plex-mark { width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); }
/* "N cities you've seen live music in, all time": a line of air above it. */
.tiny.after-gap { margin-top: calc(var(--u) * 4); }
/* When you listen: 24 columns, one per hour. */
.hour-chart { display: flex; align-items: flex-end; gap: calc(var(--u) * 0.6); width: 100%;
  height: calc(var(--u) * 36); }
.hour-chart span { flex: 1; background: var(--ink-dim); border-radius: calc(var(--u) * 0.6) calc(var(--u) * 0.6) 0 0;
  min-height: calc(var(--u) * 0.8); }
.hour-chart span.peak { background: #fff; }
.hour-axis { display: flex; justify-content: space-between; width: 100%; margin-top: calc(var(--u) * 1.6); }

/* ---------- round 6 ---------- */
/* A big number's comma reaches below its line (line-height 0.9), into the word under it: "7,071"
   sat on "minutes". The word under a number gets its own room. */
.big + .h1, .big + .h2, .big + .h3, .big + .p, .big + .kicker { margin-top: calc(var(--u) * 3); }
.live-stats i { margin-top: calc(var(--u) * 1.4); }
.summary .stat-big { padding-bottom: calc(var(--u) * 0.8); }

/* ---------- round 8 ---------- */
/* Where the two halves met: the film keeps its poster shape, the soundtrack is square, as a record is.
   Its side matches the poster's width so the pair still reads as two objects of one size. */
.poster-row.duo { align-items: center; }
.poster-row.duo .art-album { width: calc(var(--u) * 34); height: calc(var(--u) * 34); border-radius: 4px;
  margin-left: calc(var(--u) * 3); transform: rotate(5deg); z-index: 1; }

/* ---------- round 9 ---------- */
/* Only while a story is being copied for sharing (see renderStory): no shadows at all. iPhone draws a
   soft shadow inside the copy as a dark smudge or slab around covers, photos and posters. */
.wr-stage.is-drawing .wr-stories * { box-shadow: none !important; text-shadow: none !important; }

/* ---------- "Share everything": the cover while each story is drawn, and the long picture's frame ---------- */
/* Stories switch with no transition while being drawn, so each is copied finished, not mid-slide. */
.wr-stage.is-compiling, .wr-stage.is-compiling .wr-story, .wr-stage.is-compiling .wr-story * {
  transition: none !important; animation-duration: .001s !important; animation-iteration-count: 1 !important; }
.compile-cover {
  position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.9); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 3);
}
.compile-cover .p { color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.share-all { margin: 0 auto; }
.share-preview .preview-scroll { max-height: 68%; width: 72%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: calc(var(--u) * 3); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.share-preview .preview-scroll img { display: block; width: 100%; max-height: none; border-radius: 0; box-shadow: none; }
