:root {
  color-scheme: dark;
  /* page colour: neutral gray when idle; app.js tints it from the song's cover */
  --bg: #1b1a1b;
  --text: #ece5e1;
  --muted: #8d807c;
  --faint: #5f5552;
  --card: #2f2523;
  --bar-bg: rgba(255, 255, 255, 0.18);
  --bar-fill: #f2ece8;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  transition: background-color 1.2s ease;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(20px, 5vh, 56px) 16px 12px;
}

/* ── text ─────────────────────────────────────────── */

.title {
  margin: 0 0 6px;
  /* sized so "## below is the current track i'm listening to" (46 characters)
     stays on one line: 28px on desktop, shrinks with the screen on phones */
  font-size: min(28px, calc((100vw - 32px) / 28));
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.title::before {
  content: "## ";
  color: var(--muted);
}

.subtitle {
  margin: 0 0 14px;
  font-size: min(15px, max(11px, calc((100vw - 32px) / 32))); /* smaller than the title on phones */
  font-weight: 600;
  color: var(--text);
  opacity: 0.85;
}

/* ── player card ──────────────────────────────────── */

.player {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: stretch;
  padding: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  animation: rise 0.5s ease both;
}
.player[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* blurred album-art glow behind everything */
.ambient {
  position: absolute;
  inset: -40%;
  z-index: -2;
  background-size: cover;
  background-position: center;
  filter: blur(48px) saturate(1.5);
  opacity: 0.85;
  transition: opacity 0.6s ease, background-image 0.6s ease;
  animation: drift 24s ease-in-out infinite alternate;
}
.player::after {
  /* darken so text stays readable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(20, 14, 13, 0.55), rgba(20, 14, 13, 0.25));
}
body.no-ambient .ambient { opacity: 0; }

@keyframes drift {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(14deg) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .ambient, .player { animation: none; }
}

/* film grain */
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.art {
  flex: none;
  width: 100px;
  height: 100px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.art { cursor: zoom-in; }

.info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.meta { min-width: 0; }

.track {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist .by { color: var(--muted); }
#artist {
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
}

.logo {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--text);
  opacity: 0.9;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.time {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 3.5ch;
}
.time:last-child { text-align: right; }
.play {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 4px;
  background: var(--bar-bg);
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--bar-fill);
  transition: width 0.25s linear;
}

/* Last.fm doesn't give a position, so the bar just shimmers */
.player.no-progress .time { visibility: hidden; }
.player.no-progress .fill {
  width: 35%;
  animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(290%); }
}

/* ── nothing playing ────────────────────────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 128px;
  padding: 24px 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: rise 0.5s ease both;
}
.empty[hidden] { display: none; }
.empty {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.empty:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.empty-face {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.empty-face.pop { animation: pop 0.25s ease; }
@keyframes pop {
  0%   { transform: scale(0.9); opacity: 0.6; }
  60%  { transform: scale(1.06); }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .empty-face.pop { animation: none; }
}
.empty-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* "last.fm isn't answering, this is from 2h ago" over recently played / listening stats */
.stale-note {
  margin: -8px 0 12px;
  font-size: 11px;
  color: var(--faint);
}
.stale-note[hidden] { display: none; }

/* ── footnote ─────────────────────────────────────── */

.footnote {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--faint);
}
.footnote[hidden] { display: none; }

.toggle {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.toggle:hover, .toggle:focus-visible { color: var(--muted); }

/* ── recently played ─────────────────────────────── */

.recent { margin-top: 28px; }
.recent[hidden] { display: none; }

.heading {
  margin: 0 0 6px;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
}
.heading::before { content: "## "; color: var(--muted); }

/* scrollable box, ~10 songs tall */
.recent-box {
  position: relative;
  margin-top: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.recent-box:not(.scrolls)::after { display: none; }
.recent-box::after {
  /* fade at the bottom hints there's more to scroll */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.35));
  transition: opacity 0.2s ease;
}
/* scrolled to the bottom: nothing more to hint at, so drop the fade */
.recent-box.at-end::after { opacity: 0; }
.recent-list {
  list-style: none;
  margin: 0;
  padding: 4px 14px;
  /* app.js sets max-height so the list ends at the bottom of the screen */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.recent-item[hidden] { display: none; }
.recent-list::-webkit-scrollbar { width: 8px; }
.recent-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}
.recent-item a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 4px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
.recent-item a:hover,
.recent-item a:focus-visible { background: rgba(255, 255, 255, 0.05); }

.recent-art {
  cursor: zoom-in;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}
.recent-text { min-width: 0; }
.recent-title,
.recent-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.recent-artist { font-size: 12px; line-height: 1.35; color: var(--muted); }
.recent-time {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}


.more {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.more[hidden] { display: none; }
.more:hover,
.more:focus-visible { color: var(--text); }

/* ── links to the other pages ───────────────────── */

.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 48px;
  font-size: 14px;
  font-weight: 600;
}
.site-foot {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
}
.site-foot:empty { display: none; }
.contact-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.contact-pill {
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.contact-pill svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.contact-pill:hover,
.contact-pill:focus-visible,
.contact-pill[data-open] { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.contact-pill[data-copied]::after {
  content: "copied";
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--faint);
}
.site-links a {
  color: var(--muted);
  text-decoration: none;
}
.site-links a::before { content: "["; color: var(--faint); }
.site-links a::after { content: "]"; color: var(--faint); }
.site-links a:hover,
.site-links a:focus-visible,
.site-links a[aria-current="page"] { color: var(--text); }

/* ── enlarged cover ──────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lightbox img {
  max-width: min(90vw, 640px);
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}
.lightbox.open img { transform: none; }

/* ── phones ───────────────────────────────────────── */

@media (max-width: 520px) {
  .player { gap: 12px; padding: 12px; }
  .art { width: 72px; height: 72px; }
  .track { font-size: 15px; }
  .footnote { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ── /surf ────────────────────────────────────────── */

.surf .title { white-space: normal; font-size: clamp(22px, 6vw, 28px); }
.surf-loading { font-size: 13px; color: var(--muted); }
.surf-loading[hidden],
.surf-section[hidden],
.surf-error[hidden],
.surf-sub[hidden],
.surf-item[hidden],
.ksf-stats[hidden],
.surf .subtitle[hidden] { display: none; }

.surf-section { margin-top: 28px; }
.surf-section.off { display: none !important; } /* hidden in /dashboard */
.surf-sub {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.surf-sub::before { content: "### "; color: var(--faint); }
/* the replay analyzer's heading: its own class, so the momentum error message doesn't hide it */
.replay-analyzer-title {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.replay-analyzer-title::before { content: "### "; color: var(--faint); }
/* the "open ↗" chip by the heading, styled like the other headings' "copy link" */
.replay-analyzer-title .replay-analyzer-open {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  vertical-align: middle;
  transition: color 0.15s ease, background 0.15s ease;
}
.replay-analyzer-title .replay-analyzer-open:hover,
.replay-analyzer-title .replay-analyzer-open:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.12); outline: none; }
/* the page's own width while it only asks for a run; once a run is analysed (.wide, from
   public/replay-analyzer/embed.js) as wide as /replayanalyzer itself, so the side-by-side
   replays, charts and tables get the same room as on their own page; 16px gutters on small screens */
.replay-analyzer-frame {
  --ra-w: 100%;
  display: block;
  width: var(--ra-w);
  max-width: none;
  margin-left: calc((100% - var(--ra-w)) / 2);
  height: 230px; /* until the analyzer reports its real height (public/replay-analyzer/embed.js) */
  border: 0;
  background: transparent;
  color-scheme: dark;
}
.replay-analyzer-frame.wide { --ra-w: min(1140px, calc(100vw - 32px)); }

/* the tools box on /surf: search my maps / compare / find your stats / replay analyzer as tabs */
.surf-tools {
  margin-top: 22px;
  padding: 12px 14px 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  scroll-margin-top: 12px;
}
/* a run's results are wider than the box: the box's background would show as a band behind them */
.surf-tools:has(.replay-analyzer-frame.wide:not([hidden])):has(#tool-analyzer:not([hidden])) { background: none; padding-left: 0; padding-right: 0; }
.surf-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}
.surf-tab {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.surf-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.surf-tab:focus-visible { outline: 2px solid rgba(232, 137, 216, 0.6); outline-offset: 1px; color: var(--text); }
.surf-tab[aria-selected="true"] { color: var(--text); background: rgba(232, 137, 216, 0.22); }
.surf-tabs .surf-tabs-link { margin-left: auto; }
.surf-tool[hidden] { display: none; }
.surf-tool > .surf-all-note:first-child { margin-top: 0; }
@media (max-width: 520px) {
  .surf-tools { padding: 10px 10px 12px; }
  .surf-tab { padding: 5px 8px; font-size: 11px; }
}
.surf-error { font-size: 12px; color: var(--muted); }
.surf-none { font-size: 12px; color: var(--faint); padding: 6px 0; }

/* stats panel */
.ksf-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 20px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.ksf-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px 14px;
  align-content: start;
}
.ksf-num { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ksf-num-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ksf-num-value {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ksf-num-of { font-size: 10px; font-weight: 600; color: var(--faint); }
/* play time you can tap to switch hours ↔ days (time-toggle.js) */
.time-toggle {
  cursor: pointer;
  text-decoration: underline dotted var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  border-radius: 3px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.time-toggle:hover { text-decoration-color: var(--muted); }
.time-toggle:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.ksf-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ksf-bars { display: flex; flex-direction: column; gap: 6px; }
.ksf-bar-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}
.ksf-bar-n { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ksf-bar-row .ksf-bar-n:first-child { text-align: right; }
.ksf-bar {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.ksf-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 2px;
  /* square end: the track's rounded edge clips the left side, so a small % stays a thin strip
     instead of a round blob over the "maps" / "stages" label */
  background: #e889d8;
}
.ksf-bar-stages { background: #d6c84a; }
.ksf-bar-bonuses { background: #6fb6e8; }
.ksf-bar-name,
.ksf-bar-pct {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.ksf-bar-name { left: 8px; }
.ksf-bar-pct { left: 50%; transform: translate(-50%, -50%); }
.ksf-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ksf-counts[hidden] { display: none; }
.ksf-count { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ksf-count-label {
  width: 100%;
  padding: 4px 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.ksf-count-value { font-size: 12px; font-variant-numeric: tabular-nums; }

/* map rows */
.surf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.surf-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding-right: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
a.surf-row:hover,
a.surf-row:focus-visible { background: rgba(255, 255, 255, 0.07); }
.surf-thumb {
  position: relative;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.surf-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.surf-thumb.loaded img { opacity: 1; }
.surf-thumb-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-size: 10px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.surf-mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
  padding: 6px 0;
}
.surf-map {
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.surf-map.inline { font-size: inherit; }
.surf-chip {
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.surf-chip.dim { color: var(--muted); }
/* momentum: tap a map's picture or name to see if it's ranked, beta or unranked */
.surf-status-tap { cursor: help; }
.surf-status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  font-size: 11px;
  font-weight: 700;
  color: var(--text, #eee);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.surf-item.show-status .surf-status { opacity: 1; }
.surf-activity { font-size: 13px; min-width: 0; }
.surf-activity b { color: var(--muted); font-weight: 700; }
.surf-trophy { width: 16px; height: 16px; flex: none; }
.surf-date {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .ksf-stats { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .surf-row { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; padding-right: 10px; }
  .surf-thumb { height: 100%; min-height: 44px; }
  .surf-map { font-size: 12px; }
  .surf-activity { font-size: 12px; }
  .surf-chip.wr-diff { display: none; }
  /* map rows on phones: the date goes under the chips instead of in its own column, so the
     chips get that width and sit side by side instead of one per line */
  .surf-row:not(.dbd-ach) { grid-template-columns: 76px minmax(0, 1fr); row-gap: 0; }
  .surf-row:not(.dbd-ach) .surf-thumb { grid-row: 1 / span 2; align-self: stretch; }
  .surf-row:not(.dbd-ach) .surf-mid { padding-bottom: 2px; gap: 5px 6px; }
  .surf-row:not(.dbd-ach) .surf-date { grid-column: 2; padding-bottom: 6px; font-size: 10px; }
  .surf-row:not(.dbd-ach) .surf-date:empty { display: none; }
  .surf-row:not(.dbd-ach) .surf-chip { padding: 3px 7px; }
}
.mm-stats { grid-template-columns: minmax(0, 1fr); margin-bottom: 4px; }
.mm-stats .ksf-numbers { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
/* maps per rank 1-10 / group g1-g6: two flat rows under the numbers */
.mm-places[hidden] { display: none; }
#ksf-places { grid-column: 1 / -1; }
.mm-places {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.mm-place-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 56px;
  gap: 10px;
  align-items: center;
}
.mm-place-name { font-size: 11px; color: var(--muted); }
.mm-place-cells { display: grid; gap: 6px; }
.mm-place-ranks { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.mm-place-groups { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.mm-place-points { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mm-place-approx { font-size: 11px; font-weight: 400; color: var(--muted); margin-right: 1px; }
.mm-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  cursor: default;
}
.mm-place-label { font-size: 10px; color: var(--muted); }
.mm-place-value { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mm-place.zero .mm-place-value { color: var(--faint); }
.mm-place-total { background: rgba(232, 137, 216, 0.12); }
@media (max-width: 640px) {
  .mm-place-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .mm-place-name { grid-column: 1 / -1; }
  .mm-place-ranks { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mm-place-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mm-place-points { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.surf-chip-of { color: var(--faint); font-size: 10px; }
.surf-chip.hot { background: rgba(232, 137, 216, 0.22); }
/* group / top % chips: a color picked in /dashboard (pink by default), fading the further from the wr */
.surf-chip.lv { background: rgba(var(--chip-rgb), var(--a)); }
.surf-chip.lv.grp { --chip-rgb: var(--grp-rgb, 232, 137, 216); }
.surf-chip.lv.pct { --chip-rgb: var(--pct-rgb, 232, 137, 216); }
.surf-chip.lv1 { --a: 0.45; }
.surf-chip.lv2 { --a: 0.38; }
.surf-chip.lv3 { --a: 0.32; }
.surf-chip.lv4 { --a: 0.26; }
.surf-chip.lv5 { --a: 0.21; }
.surf-chip.lv6 { --a: 0.16; }
.surf-chip.lv7 { --a: 0.12; }
.surf-chip.lv8 { --a: 0.07; color: var(--muted); }

/* "show all maps i've completed": scrollable box, like the songs list on the home page */
#ksf-all-btn, #momentum-all-btn { margin: 8px 0 4px; }
.surf-all[hidden], .surf-all-note[hidden] { display: none; }
.more[disabled] { opacity: 0.6; cursor: default; }
.surf-all-note { margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.surf-sort { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 10px; }
.surf-sort[hidden] { display: none; }
.surf-sort .more { margin: 0; }
.surf-sort .more[aria-pressed="true"] { color: var(--text); }
.surf-scroll {
  position: relative;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  /* fade at the bottom hints there's more to scroll */
  -webkit-mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 32px), transparent);
}
.surf-scroll:not(.scrolls),
.surf-scroll.at-end { -webkit-mask-image: none; mask-image: none; }
.surf-scroll::-webkit-scrollbar { width: 8px; }
.surf-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 8px; }

/* no wr/cp/b/top row: let the completion bars fill the space instead */
.ksf-side:has(.ksf-counts[hidden]) { justify-content: center; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bars { gap: 12px; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar { height: 28px; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar-name,
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar-pct { font-size: 13px; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar-name { left: 12px; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar-n { font-size: 12px; }
.ksf-side:has(.ksf-counts[hidden]) .ksf-bar-row { grid-template-columns: 44px minmax(0, 1fr) 44px; }

/* "← home" in the top-left corner, like on /meow */
.home-link {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  font-size: 12px;
  color: var(--faint);
  text-decoration: none;
}
.home-link:hover, .home-link:focus-visible { color: var(--text); }
.wrap.surf { padding-top: max(44px, clamp(20px, 5vh, 56px)); }

/* ── /dbd ─────────────────────────────────────────── */

#dbd[hidden], .dbd-adepts[hidden], .dbd .more[hidden] { display: none; }
.dbd-profile { display: flex; align-items: center; gap: 14px; margin: 18px 0 14px; min-width: 0; }
.dbd-avatar { width: 56px; height: 56px; border-radius: 8px; flex: none; }
.dbd-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dbd-name { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; min-width: 0; }
.dbd-status { font-size: 11px; font-weight: 600; color: var(--muted); }
.dbd-status::before { content: "● "; color: var(--faint); }
.dbd-status.on::before { color: #7fd17f; }
.dbd-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ksf-stats.one-col { grid-template-columns: minmax(0, 1fr); }

.dbd .ksf-num { gap: 4px; }
.dbd-top {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.dbd-top.hot { background: rgba(232, 137, 216, 0.22); color: var(--text); }

.dbd-splits { justify-content: flex-start; gap: 18px; }
.dbd-overview .ksf-numbers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dbd-overview .dbd-splits[hidden] { display: none; }
.dbd-note-small { font-size: 10px; color: var(--faint); }
@media (max-width: 640px) { .dbd-overview .ksf-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dbd-extras { margin: 0; }
.dbd-split { display: flex; flex-direction: column; gap: 6px; }
.dbd-split-bar { display: flex; gap: 2px; height: 18px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.dbd-split-a { background: #e889d8; }
.dbd-split-b { background: #6fb6e8; }
.dbd-split-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: var(--muted); }

.dbd-rank { display: flex; flex-direction: column; gap: 4px; }
.dbd-rank-row { display: flex; align-items: center; gap: 12px; }
.dbd-pips { display: flex; gap: 4px; }
.dbd-pip { width: 10px; height: 10px; transform: rotate(45deg); border: 1px solid var(--muted); }
.dbd-pip.on { background: #e889d8; border-color: #e889d8; }

.dbd-buttons { display: flex; flex-wrap: wrap; gap: 0 18px; }
.dbd-adepts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}
.dbd-adept { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; font-size: 10px; font-weight: 600; text-align: center; }
.dbd-adept-icon { width: 40px; height: 40px; flex: none; border-radius: 6px; background: rgba(255,255,255,0.05); overflow: hidden; }
.dbd-adept-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dbd-adept.missing { color: var(--faint); }
.dbd-adept.missing .dbd-adept-icon { filter: grayscale(1); opacity: 0.45; }

.dbd .surf-all { margin-top: 8px; }
.dbd-statlist { list-style: none; margin: 0 0 6px; padding: 0; }
.dbd-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 6px; font-size: 12px; border-radius: 6px; }
.dbd-stat:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.dbd-stat-label { color: var(--muted); min-width: 0; }
.dbd-stat-right { display: flex; align-items: baseline; gap: 8px; flex: none; }
.dbd-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.dbd .surf-scroll .surf-sub:first-child { margin-top: 4px; }

.dbd-ach-bar { margin-bottom: 4px; }
.dbd-ach { grid-template-columns: 44px minmax(0, 1fr) auto; }
.dbd-ach-icon { width: 44px; height: 44px; background: rgba(255, 255, 255, 0.06); }
.dbd-ach-icon img { width: 100%; height: 100%; display: block; }
.dbd-ach-mid { flex-direction: column; align-items: flex-start; gap: 2px; }
.dbd-ach-desc { font-size: 11px; color: var(--muted); }
.dbd-checker { margin-top: 28px; }
.dbd-checker[hidden] { display: none; }
.dbd-ach.missing { opacity: 0.55; }
/* "● last online 3 days ago · playing since jan 2025", under the subtitle */
.dbd-seen { margin: -8px 0 12px; font-size: 11px; color: var(--muted); }
.dbd-seen[hidden] { display: none; }
.dbd-seen .dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--faint); vertical-align: 1px; }
.dbd-seen .dot.on { background: #7bd88f; box-shadow: 0 0 6px #7bd88f; }
.dbd-seen b { color: var(--text); font-weight: 600; }
.dbd-note { margin-top: 24px; font-size: 11px; color: var(--faint); }
.dbd-note:empty { display: none; }
@media (max-width: 520px) {
  .dbd-ach { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .dbd-ach-icon { width: 40px; height: 100%; min-height: 40px; }
}

/* ── /fortnite ───────────────────────────────────── */

#fn[hidden], #fn-stats[hidden], #fn-window-error[hidden] { display: none; }
.fn-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 4px 0 14px; }
.fn-tabs { display: flex; gap: 16px; }
.fn-pass { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fn-pass[hidden] { display: none; }
.fn-pass-label { color: var(--muted); }
.fn-pass-track { position: relative; width: 70px; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.fn-pass-fill { position: absolute; inset: 0 auto 0 0; background: #e889d8; }
.fn-modes-box { gap: 14px; }
#fn-share[hidden] { display: none; }
.fn-legend { justify-content: flex-start; flex-wrap: wrap; gap: 4px 14px; }
.fn-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.fn-modes { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.fn-tabs .more { margin: 0; }
.fn-tabs .more[aria-pressed="true"] { color: var(--text); }
.fn-modes {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(5, minmax(0, 1fr));
  gap: 8px 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.fn-modes span { text-align: right; white-space: nowrap; }
.fn-modes .fn-head { font-size: 11px; color: var(--muted); }
.fn-modes span:nth-child(6n + 1) { text-align: left; }
.fn-mode { font-weight: 600; }
@media (max-width: 480px) {
  .fn-modes { font-size: 12px; gap: 8px 8px; }
}

@media (max-width: 480px) {
  .site-links { column-gap: 18px; }
}
/* touch screens: the page links, "← home" and the small [toggles] get a bigger area to tap
   (padding that a negative margin takes back, so nothing moves) */
@media (pointer: coarse) {
  .site-links a, .toggle { padding-block: 7px; margin-block: -7px; }
  .home-link { padding: 10px; margin: -10px; }
}

/* ── /songsearch ─────────────────────────────────── */

.ss-form { display: flex; gap: 8px; margin: 4px 0 10px; max-width: 560px; }
.ss-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px+ so phones don't zoom in on focus */
}
.ss-input::placeholder { color: var(--faint); }
.ss-input:focus { outline: none; border-color: rgba(232, 137, 216, 0.6); background: rgba(255, 255, 255, 0.06); }
.ss-go {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: rgba(232, 137, 216, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.ss-go:hover, .ss-go:focus-visible { background: rgba(232, 137, 216, 0.36); outline: none; }
.ss-go[disabled] { opacity: 0.6; cursor: default; }
.ss-formats { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.ss-formats-label { margin-right: 2px; }
.ss-format {
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
}
.ss-format:hover, .ss-format:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.08); outline: none; }
.ss-format[aria-pressed="true"] { color: var(--text); background: rgba(232, 137, 216, 0.22); border-color: rgba(232, 137, 216, 0.5); }
.songsearch .ss-results { margin-top: 14px; }
.ss-results .subtitle { margin-bottom: 0; font-size: 12px; color: var(--muted); }
.ss-results.ss-stale .ss-list { opacity: 0.5; transition: opacity 0.15s ease; }
.ss-list { padding-top: 6px; padding-bottom: 6px; }
.ss-more-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.ss-more-box[hidden] { display: none; }
.ss-more-box .ss-bulk-go { font-weight: 600; }
.ss-item + .ss-item { margin-top: 2px; }
.ss-row { border-radius: 8px; transition: background 0.15s ease; }
.ss-row:hover { background: rgba(255, 255, 255, 0.04); }
.ss-art { cursor: default; }
.ss-side { display: flex; align-items: center; gap: 10px; }
.recent-item .ss-get {
  display: inline-block;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #e889d8;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.recent-item .ss-get:hover, .recent-item .ss-get:focus-visible { color: var(--text); background: rgba(232, 137, 216, 0.22); outline: none; }
.ss-play, .ss-add, .ss-tag {
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.ss-play:hover, .ss-play:focus-visible, .ss-add:hover, .ss-add:focus-visible, .ss-tag:hover, .ss-tag:focus-visible, .ss-tag[aria-expanded="true"] { color: var(--text); background: rgba(255, 255, 255, 0.08); outline: none; }
.recent-item .ss-get[aria-busy="true"] { cursor: progress; color: var(--muted); }
/* a download going on: no new songs in the player until it's done */
.ss-play:disabled, .ss-add:disabled { color: var(--faint); background: none; cursor: not-allowed; }
/* the result that's in the player */
.ss-now .ss-row { background: rgba(232, 137, 216, 0.08); box-shadow: inset 2px 0 #e889d8; }
.ss-now .ss-row:hover { background: rgba(232, 137, 216, 0.12); }
.ss-now .recent-title { color: #f1b3e6; }
.ss-now .ss-play { color: #e889d8; }
.ss-status { margin-top: 2px; font-size: 11px; color: var(--muted); }
.ss-status-error { color: #e98b8b; }
.recent-item .ss-status a {
  display: inline;
  padding: 0;
  margin: 0;
  border-radius: 0;
  color: var(--muted);
  text-decoration: underline;
  white-space: nowrap;
}
.recent-item .ss-status a:hover, .recent-item .ss-status a:focus-visible { background: none; color: var(--text); }
.ss-ready {
  font-size: 10px;
  font-weight: 700;
  color: #f0be5a;
  white-space: nowrap;
  vertical-align: 1px;
}
.ss-note { margin-top: 18px; line-height: 1.6; }
.ss-note p { margin: 0 0 6px; }
.ss-more summary { cursor: pointer; list-style: none; width: fit-content; color: var(--muted); }
.ss-more summary::-webkit-details-marker { display: none; }
.ss-more summary:hover, .ss-more summary:focus-visible { color: var(--text); }
.ss-more[open] summary { margin-bottom: 4px; }
.ss-more ul { margin: 0; padding-left: 16px; }
.ss-more li { margin-bottom: 4px; }
.ss-more li b:first-child { color: var(--muted); }
.ss-note a { color: inherit; }
.recent-item .recent-row.ss-row { grid-template-columns: 16px 36px minmax(0, 1fr) auto; gap: 10px; }
.ss-pick { width: 15px; height: 15px; margin: 0; accent-color: #e889d8; cursor: pointer; }
.ss-pick:disabled { cursor: default; }
/* pressing a tick box and dragging ticks the songs passed (songsearch.js), so a touch there doesn't scroll */
.ss-list .ss-pick { touch-action: none; }
.ss-picked .ss-row { background: rgba(255, 255, 255, 0.03); }
.ss-bulk[hidden] { display: none; }
.songsearch .ss-bulk { margin-top: 14px; }
.songsearch .ss-bulk:not([hidden]) + .ss-results { margin-top: 4px; }
.ss-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 2px; font-size: 12px; color: var(--muted); }
.ss-pick-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ss-bulk-go {
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #e889d8;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.ss-bulk-go:hover:not(:disabled), .ss-bulk-go:focus-visible { color: var(--text); background: rgba(232, 137, 216, 0.22); outline: none; }
.ss-bulk-go:disabled { color: var(--faint); cursor: default; }
.ss-bulk-status { font-size: 11px; }
.ss-bulk-ask { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text); }
.ss-bulk-ask[hidden], .ss-bulk-go[hidden] { display: none; }
/* the tag editor under a song */
.ss-item.ss-editing { background: rgba(232, 137, 216, 0.06); }
.ss-edit { display: grid; gap: 8px; padding: 10px 10px 12px 44px; border-radius: 6px; }
.ss-edit.ss-edit-drop { outline: 2px dashed rgba(232, 137, 216, 0.6); outline-offset: -4px; }
.ss-edit-pic { display: flex; align-items: center; gap: 12px; }
.ss-edit-art { width: 72px; height: 72px; flex: none; border-radius: 6px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.ss-edit-pic-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.ss-edit-pic-buttons .ss-bulk-go { margin-left: -6px; margin-right: 6px; }
.ss-edit-hint { flex-basis: 100%; margin: 2px 0 0; font-size: 11px; color: var(--faint); }
.ss-edit-field { display: grid; gap: 3px; font-size: 11px; color: var(--muted); }
.ss-edit .ss-edit-input, .ss-edit .ss-edit-link { width: 100%; box-sizing: border-box; padding: 7px 10px; font-size: 14px; }
.ss-edit .ss-edit-link { font-size: 12px; }
.ss-edit .ss-edit-link[hidden] { display: none; }
.ss-edit-go { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-left: -6px; }
.ss-edit-status { margin: 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.ss-edit-status:empty { display: none; }
@media (max-width: 520px) { .ss-edit { padding-left: 8px; } }
.ss-artist { flex-wrap: wrap; row-gap: 6px; margin: 2px 0 10px; }
.ss-artist[hidden] { display: none; }
.ss-artist-gap { margin-left: 8px; }
.ss-artist-kinds { display: contents; }
.ss-artist-kinds[hidden] { display: none; }
.ss-artist .ss-reroll { margin-left: 4px; font-weight: 600; }
.ss-artist .ss-reroll[hidden] { display: none; }
.ss-artist-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.ss-artist-when[hidden], .ss-when-pick[hidden], .ss-when-at[hidden], .ss-when-dates[hidden], .ss-when-step[hidden] { display: none; }
.ss-when-dates { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ss-when-pick { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 4px; }
.ss-when-step { padding: 3px 8px; }
.ss-when-at {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 6px;
  color-scheme: dark;
  min-width: 0;
}
.ss-when-at:focus-visible { outline: none; border-color: rgba(232, 137, 216, 0.5); }
.ss-when-at[aria-invalid="true"] { border-color: rgba(255, 110, 110, 0.7); }
#ss-at-year { width: 5.5em; }
.ss-when-range { color: var(--muted); }
.ss-where { margin: -4px 0 8px; font-size: 12px; }
.ss-where[hidden] { display: none; }
.ss-where .ss-bulk-go { margin-left: -6px; font-weight: 600; }
@media (max-width: 480px) {
  .ss-side { gap: 4px; }
  .recent-item .recent-row.ss-row { gap: 8px; }
  .ss-side .recent-time { display: none; }
}

/* ── /songsearch: the song player (song-player.js) ── */
.sp { --sp-accent: #e889d8; margin: 14px 0 0; }
.sp[hidden] { display: none; }
.sp-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 14px;
  background: #2a2224;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* the cover, blurred, behind everything */
.sp-card::before {
  content: "";
  position: absolute;
  inset: -50px;
  z-index: -2;
  background: var(--sp-art, none) center 45% / cover;
  filter: blur(32px) saturate(1.15);
  opacity: 0.5;
}
.sp-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(95deg, rgba(27, 26, 27, 0.2), rgba(27, 26, 27, 0.5) 50%, rgba(27, 26, 27, 0.82));
}
.sp-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #3a2f2d;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.sp-info { min-width: 0; }
.sp-meta { min-width: 0; padding-right: 26px; }
.sp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(236, 229, 225, 0.8);
}
.sp-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sp-bars i { width: 2px; height: 4px; border-radius: 1px; background: var(--sp-accent); }
.sp-playing .sp-bars i { animation: sp-bar 0.8s ease-in-out infinite alternate; }
.sp-playing .sp-bars i:nth-child(2) { animation-delay: -0.3s; }
.sp-playing .sp-bars i:nth-child(3) { animation-delay: -0.55s; }
.sp-playing .sp-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes sp-bar { from { height: 3px; } to { height: 12px; } }
.sp-title {
  margin: 6px 0 3px;
  font-size: clamp(17px, 2.6vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-artist { font-size: 12px; color: rgba(236, 229, 225, 0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-timeline { margin-top: 10px; }
.sp-times { display: flex; justify-content: space-between; font-size: 11px; color: rgba(236, 229, 225, 0.7); }
.sp-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.sp-transport, .sp-extras { display: flex; align-items: center; gap: 4px; }
.sp button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sp button:hover { background: rgba(255, 255, 255, 0.1); }
.sp button:focus-visible, .sp input:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }
.sp button[disabled] { opacity: 0.35; cursor: default; background: transparent; }
.sp svg { width: 20px; height: 20px; }
.sp .sp-toggle { width: 44px; height: 44px; background: var(--sp-accent); color: #22161f; }
.sp .sp-toggle:hover { background: #f2a9e5; }
.sp .sp-toggle[aria-busy="true"] { cursor: progress; }
.sp-spin { animation: sp-spin 0.9s linear infinite; }
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp .sp-repeat { position: relative; color: rgba(236, 229, 225, 0.55); }
.sp .sp-repeat[data-mode="all"], .sp .sp-repeat[data-mode="one"] { color: var(--sp-accent); }
.sp .sp-repeat svg { width: 18px; height: 18px; }
.sp .sp-repeat[data-mode="one"]::after {
  content: "1"; position: absolute; top: 4px; right: 3px; min-width: 12px; height: 12px; border-radius: 6px;
  background: var(--sp-accent); color: #22161f; font: 800 9px/12px system-ui, sans-serif; text-align: center;
}
.sp .sp-speed { width: auto; min-width: 44px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.sp .sp-speed.sp-changed { color: var(--sp-accent); background: rgba(232, 137, 216, 0.14); }
.sp .sp-speed[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.sp .sp-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; color: rgba(236, 229, 225, 0.6); }
.sp .sp-close svg { width: 16px; height: 16px; }
.sp .sp-close:hover { color: var(--text); }
/* phones set the volume with their own buttons */
@media (hover: none) { .sp-vol { display: none; } }
.sp input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 0%;
}
.sp .sp-vol { width: 72px; }
.sp input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--sp-accent) var(--p), rgba(255, 255, 255, 0.22) var(--p));
}
.sp input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--sp-accent) var(--p), rgba(255, 255, 255, 0.22) var(--p));
}
.sp input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #f6eef2;
}
.sp input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #f6eef2; }
.sp-speedbox { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
.sp-speedbox[hidden] { display: none; }
.sp-speeds { display: flex; flex-wrap: wrap; gap: 4px; }
.sp .sp-speeds button {
  width: auto;
  height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(236, 229, 225, 0.8);
}
.sp .sp-speeds button[aria-pressed="true"] { color: var(--text); background: rgba(232, 137, 216, 0.24); border-color: rgba(232, 137, 216, 0.55); }
.sp-pitch { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; cursor: pointer; }
.sp-pitch span { color: rgba(236, 229, 225, 0.6); }
.sp-pitch input { margin: 0; accent-color: var(--sp-accent); }
.sp-msg { margin-top: 4px; font-size: 11px; color: rgba(236, 229, 225, 0.75); }
.sp-msg:empty { display: none; }
.sp-msg.sp-error { color: #e98b8b; }

/* the queue, under the player */
.sp-queue { margin-top: 8px; padding: 6px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.03); }
.sp-queue[hidden] { display: none; }
.sp-qhead { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 4px; font-size: 11px; color: var(--muted); }
.sp .sp-qclear { width: auto; height: auto; padding: 2px 4px; border-radius: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.sp .sp-qclear:hover { color: var(--text); }
.sp-qlist { list-style: none; margin: 0; padding: 0; max-height: 236px; overflow-y: auto; overscroll-behavior: contain; }
.sp-qitem { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.sp-qitem:hover { background: rgba(255, 255, 255, 0.04); }
.sp .sp-qjump {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: left;
}
.sp .sp-qjump:hover { background: none; }
.sp-qnum { flex: none; width: 20px; font-size: 11px; text-align: right; color: var(--faint); }
.sp-qart { flex: none; width: 28px; height: 28px; border-radius: 4px; object-fit: cover; background: #3a2f2d; }
.sp-qtext { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sp-qtitle, .sp-qartist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-qtitle { font-size: 12px; font-weight: 700; }
.sp-qartist { font-size: 11px; color: var(--muted); }
.sp-qtime { flex: none; font-size: 11px; color: var(--faint); }
.sp-qitem .ss-pick { flex: none; margin-left: 6px; }
.sp-qitem.sp-qpicked { background: rgba(255, 255, 255, 0.03); }
.sp-qtools { display: flex; align-items: center; gap: 8px; }
.sp-qpickall { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.sp-qpickall[hidden] { display: none; }
.sp .sp-qremove { flex: none; width: 28px; height: 28px; font-size: 15px; color: var(--muted); }
.sp .sp-qremove:hover { color: var(--text); }
.sp .sp-qremove[disabled] { visibility: hidden; }
.sp-qitem.sp-past { opacity: 0.5; }
.sp-qitem.sp-now .sp-qtitle, .sp-qitem.sp-now .sp-qnum { color: var(--sp-accent); }

@media (max-width: 560px) {
  .sp-card { grid-template-columns: 76px minmax(0, 1fr); gap: 10px 14px; padding: 14px; }
  .sp-info { display: contents; }
  .sp-timeline, .sp-actions, .sp-speedbox, .sp-msg { grid-column: 1 / -1; }
  .sp-timeline { margin-top: 0; }
  .sp-actions, .sp-msg, .sp-speedbox { margin-top: -6px; }
  .sp-title { font-size: 17px; }
}

/* full screen: the cover big */
.sp.sp-expanded { position: fixed; inset: 0; z-index: 2147483000; margin: 0; background: #151314; overflow: auto; }
.sp-expanded .sp-card {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  grid-template-columns: minmax(0, min(52vw, 78vh)) minmax(260px, 420px);
  justify-content: center;
  align-content: center;
  gap: 4vw;
  padding: 4vw;
}
.sp-expanded .sp-info { display: block; }
.sp-expanded .sp-cover { border-radius: 12px; }
.sp-expanded .sp-title { margin-top: 14px; font-size: clamp(24px, 3.4vw, 48px); white-space: normal; overflow-wrap: anywhere; }
.sp-expanded .sp-artist { font-size: 15px; white-space: normal; }
.sp-expanded .sp-timeline { margin-top: 22px; }
.sp-expanded .sp-actions { margin-top: 10px; }
.sp-expanded .sp-speedbox, .sp-expanded .sp-msg { margin-top: 8px; }
.sp-expanded .sp-close, .sp-expanded .sp-queue { display: none; }
@media (max-width: 850px) and (orientation: portrait) {
  .sp-expanded .sp-card { grid-template-columns: minmax(0, min(100%, 52vh)); padding: 24px 20px; gap: 20px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .sp-expanded .sp-card { grid-template-columns: min(40vw, 78vh) minmax(230px, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-playing .sp-bars i { animation: none; height: 8px; }
  .sp-spin { animation-duration: 2.5s; }
}

/* ── /movies ─────────────────────────────────────── */

#mv[hidden] { display: none; }
.movies .recent { margin-top: 28px; }
/* rows look like the ones on / */
.recent-item .recent-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 4px 8px;
  margin: 0 -8px;
}
.mv-poster { height: 54px; cursor: zoom-in; }
.mv-stars { color: var(--text); letter-spacing: 1px; font-size: 14px; line-height: 1; white-space: nowrap; }
/* half star: a dim star with its left half lit */
.mv-half { position: relative; display: inline-block; color: rgba(255, 255, 255, 0.25); }
.mv-half::before {
  content: "★";
  position: absolute;
  inset: 0;
  color: var(--text);
  clip-path: inset(0 50% 0 0);
}
.mv-heart { margin-left: 6px; color: #e889d8; }
/* average rating: ★★★★☆ after "4.0 / 5" */
.mv-meter { margin-left: 8px; font-size: 13px; font-weight: 400; vertical-align: 1px; }
.mv-dim { color: rgba(255, 255, 255, 0.25); }
/* "5 star films" is a button that opens the list of them */
.mv-five-toggle {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
}
.mv-five-toggle:hover .mv-five-hint,
.mv-five-toggle[aria-expanded="true"] .mv-five-hint { color: var(--muted); }
.mv-five-toggle:focus-visible { outline: 2px solid var(--muted); outline-offset: 3px; }
/* films with the rating that was tapped, under the stats */
.mv-films[hidden] { display: none; }
.mv-films {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mv-films-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mv-films-name { display: flex; align-items: baseline; gap: 4px; font-size: 12px; }
.mv-films-n { font-size: 11px; color: var(--muted); }
.mv-films-close {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.mv-films-close:hover { color: var(--text); }
.mv-films-close:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; border-radius: 3px; }
.mv-films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 14px 10px;
  max-height: min(75vh, 760px);
  overflow-y: auto;
}
.mv-film {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.mv-film-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.04);
  transition: filter 0.15s;
}
.mv-film:hover .mv-film-poster { filter: brightness(1.12); }
.mv-film-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mv-film-year { font-size: 10px; color: var(--faint); }
@media (max-width: 520px) { .mv-films-grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 12px 8px; } }
/* one bar per rating, ½ .. ★★★★★; the count sits on top of each bar */
.mv-chart {
  --h: 84px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.mv-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  border-radius: 3px;
  cursor: default;
}
.mv-bar-n {
  min-height: 12px;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.mv-bar-fill {
  height: max(4px, calc(var(--h) * var(--f, 0)));
  border-radius: 3px;
  background: #e889d8;
  transition: filter 0.15s;
}
button.mv-bar { cursor: pointer; }
button.mv-bar:hover .mv-bar-fill { filter: brightness(1.15); }
button.mv-bar:hover .mv-bar-n,
.mv-bar.on .mv-bar-n { color: var(--text); }
button.mv-bar:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
/* while a rating is open, the other bars fade back */
.mv-chart.picked .mv-bar:not(.on) .mv-bar-fill { opacity: 0.4; transition: opacity 0.15s; }
/* no films at that rating: a faint stub so every rating still has its place */
.mv-bar.zero .mv-bar-fill { height: 2px; background: rgba(255, 255, 255, 0.12); }
.mv-chart-legend {
  display: flex;
  justify-content: space-between;
  margin-top: -6px; /* .ksf-side has a 12px gap */
  line-height: 1;
}
.mv-legend-stars { font-size: 12px; color: var(--muted); }
.mv-legend-stars .mv-half::before { color: var(--muted); }

/* ── links page (meow.ibemeowing.xyz) ───────────── */

.links-wrap {
  --w: min(520px, calc(100vw - 32px));
  --gap: 16px;
  width: var(--w);
  margin: 0 auto;
  padding: clamp(28px, 8vh, 72px) 0 40px;
}
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* 3 rows make a square card */
  grid-auto-rows: max(62px, calc((var(--w) - var(--gap)) / 2 / 3 - var(--gap) * 2 / 3));
  gap: var(--gap);
  grid-template-areas:
    "music fortnite"
    "music movies"
    "music movies"
    "surf movies"
    "surf dbd"
    "minigames meow"
    "songsearch songsearch";
}
/* a card hidden in /dashboard: the rest are laid out evenly (public/links.js) */
.link-grid.loose { grid-template-areas: none; }
.link-grid.loose .link-tile { grid-area: auto !important; grid-row: span 2; }
.link-tile {
  --pic: none;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px 14px;
  border-radius: 22px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  isolation: isolate;
  transition: transform 0.2s ease;
}
.link-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--pic) center / cover no-repeat;
  filter: saturate(0.85);
  transition: transform 0.4s ease;
}
.link-tile::after {
  /* darken the bottom so the text stays readable on any picture */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.72));
}
.link-tile:hover::before,
.link-tile:focus-visible::before { transform: scale(1.04); }
.link-tile:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.link-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--text);
  color: #1b1a1b;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.link-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  text-align: right;
  /* two shadows: a tight one for the edges of the small lines on light covers, a soft one around it */
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8), 0 1px 6px rgba(0, 0, 0, 0.75);
}
/* short cards: keep the text clear of the icon */
.link-tile[data-page="fortnite"] .link-text,
.link-tile[data-page="dbd"] .link-text,
.link-tile[data-page="meow"] .link-text,
.link-tile[data-page="minigames"] .link-text,
.link-tile[data-page="songsearch"] .link-text { padding-left: 40px; }
.link-text b { font-size: 15px; font-weight: 800; }
.link-text small {
  max-width: 100%;
  font-size: 11px;
  color: rgba(233, 228, 220, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.links-wrap .site-foot { margin-top: 28px; }
@media (max-width: 420px) {
  .links-wrap { --gap: 12px; }
  .link-tile { border-radius: 18px; padding: 10px 12px; }
  .link-icon { top: 10px; left: 10px; min-width: 24px; height: 24px; font-size: 12px; }
  .link-tile[data-page="fortnite"] .link-text,
  .link-tile[data-page="dbd"] .link-text,
  .link-tile[data-page="meow"] .link-text,
  .link-tile[data-page="minigames"] .link-text,
  .link-tile[data-page="songsearch"] .link-text { padding-left: 30px; }
}
/* meow without a picture: a little dot sky like /meow */
.link-tile[data-page="meow"]:not(.has-pic)::before {
  background:
    radial-gradient(circle, rgba(233, 228, 220, 0.55) 1px, transparent 1.6px) 0 0 / 14px 14px,
    radial-gradient(circle at 70% 30%, rgba(232, 137, 216, 0.25), transparent 60%),
    #111;
}
/* minigames without a picture: a little checkerboard */
.link-tile[data-page="minigames"]:not(.has-pic)::before {
  background:
    repeating-conic-gradient(rgba(233, 228, 220, 0.07) 0 25%, transparent 0 50%) 0 0 / 20px 20px,
    radial-gradient(circle at 30% 70%, rgba(137, 216, 232, 0.22), transparent 60%),
    #111;
}
/* song search without a picture: little sound bars */
.link-tile[data-page="songsearch"]:not(.has-pic)::before {
  background:
    repeating-linear-gradient(90deg, rgba(233, 228, 220, 0.09) 0 3px, transparent 3px 9px) 0 100% / 100% 55% no-repeat,
    radial-gradient(circle at 80% 20%, rgba(232, 137, 216, 0.28), transparent 60%),
    #111;
}

/* ── /minigames ───────────────────────────────────── */
.mg-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 8px; }
.mg-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 112px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.2s ease;
}
.mg-card:hover, .mg-card:focus-visible { filter: brightness(1.12); transform: translateY(-2px); }
.mg-card:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.mg-card b { font-size: 19px; font-weight: 800; }
.mg-card small { font-size: 12px; line-height: 1.35; color: rgba(233, 228, 220, 0.72); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.mg-blocks { background: linear-gradient(115deg, #393047 10%, #342c44 55%, #273444); }
.mg-words { background: linear-gradient(115deg, #323e31 12%, #394030 70%, #322e2a); }
.mg-art { position: absolute; z-index: -1; pointer-events: none; opacity: 0.45; }
.mg-blocks-art {
  right: -8px; top: -30px;
  display: grid; grid-template-columns: repeat(4, 38px); grid-auto-rows: 38px; gap: 4px;
  transform: rotate(-9deg);
}
.mg-blocks-art i { background: #786594; border-radius: 4px; }
.mg-blocks-art i:nth-child(4n + 1) { visibility: hidden; }
.mg-blocks-art i:nth-child(6), .mg-blocks-art i:nth-child(10) { background: #55678d; }
.mg-blocks-art i:nth-child(8), .mg-blocks-art i:nth-child(11) { background: #50728b; }
.mg-words-art { right: -20px; bottom: -4px; display: flex; gap: 5px; transform: rotate(-8deg); }
.mg-words-art i {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 5px; background: #507962; font-style: normal; font-weight: 800; font-size: 22px; color: #e3e9df;
}
.mg-words-art i:nth-child(2), .mg-words-art i:nth-child(4) { background: #907a48; }
.mg-2048 { background: linear-gradient(115deg, #463629 10%, #3f3127 60%, #312a27); }
.mg-2048-art {
  right: -40px; top: -18px;
  display: grid; grid-template-columns: repeat(4, 34px); grid-auto-rows: 34px; gap: 4px;
  transform: rotate(-9deg);
}
.mg-2048-art i {
  display: grid; place-items: center; border-radius: 5px; background: #a8875f;
  font-style: normal; font-weight: 800; font-size: 12px; letter-spacing: -0.06em; color: #2b231c;
}
.mg-2048-art i:nth-child(odd) { background: #c19a63; }
.mg-2048-art i:last-child { background: #e0b955; font-size: 9px; }
.mg-slots { background: linear-gradient(115deg, #3e2747 10%, #35233f 60%, #2a2233); }
.mg-slots-art { right: -36px; top: 50%; display: flex; gap: 4px; transform: translateY(-50%) rotate(-8deg); }
.mg-slots-art img { width: 56px; height: 56px; padding: 5px; border-radius: 8px; background: #1d1724; border: 1px solid #5b4566; }
.mg-cases { background: linear-gradient(115deg, #2c3324 10%, #262c21 60%, #1f231d); }
.mg-cases-art { right: -58px; top: 50%; display: flex; gap: 2px; transform: translateY(-50%) rotate(-8deg); }
.mg-cases-art img { width: 64px; height: 48px; object-fit: contain; }
.mg-kittens { background: linear-gradient(115deg, #2a3236 10%, #252c30 60%, #1f2427); }
.mg-kittens-art {
  right: -40px; top: 50%; display: grid; gap: 3px; transform: translateY(-50%) rotate(-8deg);
  font: 600 12px/1.2 ui-monospace, Menlo, Consolas, monospace;
}
.mg-kittens-art i {
  display: flex; justify-content: space-between; gap: 14px; width: 150px; padding: 2px 7px;
  border-radius: 4px; font-style: normal; color: #dfe8ec; background: #3b484f;
}
.mg-kittens-art b { color: #9fd4a0; font-weight: 600; }
.mg-sol { background: linear-gradient(115deg, #1d4a3b 10%, #18402f 60%, #123428); }
.mg-sol-art { right: -20px; top: 50%; display: flex; transform: translateY(-50%) rotate(-8deg); }
.mg-sol-art i {
  display: block; width: 40px; height: 56px; margin-left: -12px; padding: 4px 5px; border-radius: 5px;
  background: #fbf6e8; border: 1px solid #d2c18e; box-shadow: -2px 2px 4px #0b201355;
  font: 700 13px/1.1 Georgia, serif; font-style: normal; color: #1f3530;
}
.mg-sol-art i:nth-child(2) { transform: translateY(-6px) rotate(6deg); }
.mg-sol-art i:nth-child(3) { transform: rotate(12deg); }
.mg-sol-art i.red { color: #ae3e37; }

/* ── music page: last.fm listening stats (stats.js) ── */

.lfm { margin-top: 28px; }
.lfm[hidden], .lfm-block[hidden], .lfm [hidden] { display: none; }
.lfm-block { margin-top: 14px; }
.lfm-block.loading { opacity: 0.55; transition: opacity 0.2s ease; }
.lfm-tabs { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 12px; }
.lfm-tabs .more { margin: 0; }
.lfm-tabs .more[aria-pressed="true"] { color: var(--text); }
.lfm-label {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lfm-tabs + .lfm-label { margin-top: 0; }
.lfm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 26px; }
.lfm-head + .lfm-sec .lfm-label { margin-top: 12px; }
.lfm-head .lfm-label { margin: 0; }
.lfm-range select {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.lfm-range select:hover, .lfm-range select:focus-visible { color: var(--text); }
.lfm-range option { background: #1b1a1b; color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* totals: this period vs the one before */
.lfm-bars { display: grid; gap: 10px; }
.lfm-total-text { font-size: 13px; color: var(--muted); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.lfm-total-text b { color: var(--text); font-weight: 700; }
.lfm-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.lfm-bar-fill { height: 100%; border-radius: inherit; background: #8d807c; transition: width 0.5s ease; }
.lfm-total.now .lfm-bar-fill { background: #d23c3c; }

/* artists / albums: one big tile + four small */
.lfm-mosaic {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  aspect-ratio: 2 / 1;
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}
.lfm-tile {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}
.lfm-tile:first-child { grid-row: span 2; }
.lfm-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.lfm-tile:hover img, .lfm-tile:focus-visible img { transform: scale(1.04); }
.lfm-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(0, 0, 0, 0.8));
}
.lfm-tile-text {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  z-index: 1;
  display: grid;
  gap: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.lfm-tile-text b { font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-tile-text span, .lfm-tile-text small { font-size: 11px; color: rgba(255, 255, 255, 0.82); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lfm-tile:first-child .lfm-tile-text { left: 14px; bottom: 14px; }
.lfm-tile:first-child .lfm-tile-text b { font-size: clamp(16px, 2.6vw, 22px); }

/* favorite song */
.lfm-fav-card { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 -8px; }
.lfm-fav { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lfm-fav:hover, .lfm-fav:focus-visible, .lfm-fav[aria-expanded="true"] { background: rgba(255, 255, 255, 0.05); }
.lfm-fav-play { flex: none; width: 40px; height: 40px; margin-right: 8px; border: 0; border-radius: 50%; background: rgba(210, 60, 60, 0.85); color: #fff; font-size: 14px; cursor: pointer; }
.lfm-fav-play:hover, .lfm-fav-play:focus-visible { background: rgb(225, 75, 75); }
.lfm-fav-play.loading { opacity: 0.6; cursor: progress; animation: lfm-pulse 1s ease-in-out infinite alternate; }
@keyframes lfm-pulse { to { opacity: 0.3; } }
.lfm-fav-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; border-radius: 8px; background: #16181d; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); font-size: 13px; }
.lfm-fav-menu a { color: var(--text); text-decoration: none; padding: 2px 0; }
.lfm-fav-menu a:hover, .lfm-fav-menu a:focus-visible { color: #ff6b6b; text-decoration: underline; }
.lfm-fav-ask { color: var(--muted); }
.lfm-fav-state { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.lfm-fav-art { width: 64px; height: 64px; flex: none; border-radius: 6px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.lfm-fav-text { flex: 1; min-width: 0; }
.lfm-fav-title { font-size: 16px; font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfm-fav-plays { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lfm-fav-plays b { color: var(--text, inherit); font-size: 18px; }
.lfm-fav-plays { text-align: right; }
.lfm-fav-total { font-size: 11px; color: var(--faint); }

/* top tracks */
.lfm-tracks { list-style: none; margin: 0; padding: 0; }
.lfm-track a {
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr) minmax(70px, 34%);
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
.lfm-track + .lfm-track { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.lfm-track a:hover, .lfm-track a:focus-visible { background: rgba(255, 255, 255, 0.05); }
.lfm-rank { font-size: 12px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.lfm-track-art { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.lfm-track-title, .lfm-track-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfm-track-title { font-size: 14px; font-weight: 700; line-height: 1.35; }
.lfm-track-artist { font-size: 12px; color: var(--muted); line-height: 1.35; }
.lfm-count {
  position: relative;
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, rgba(210, 60, 60, 0.22) var(--w, 100%), transparent var(--w, 100%));
  border-radius: 4px;
}

@media (max-width: 520px) {
  .lfm-mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: none; aspect-ratio: auto; grid-auto-rows: 120px; }
  .lfm-tile:first-child { grid-row: span 2; grid-column: span 2; }
  .lfm-unit { display: none; }
  .lfm-track a { grid-template-columns: 18px 32px minmax(0, 1fr) 64px; gap: 10px; }
  .lfm-track-art { width: 32px; height: 32px; }
}

/* momentum: tap the time on a row → menu with my fastest times on that map */
.surf-chip.mm-times-btn { cursor: pointer; transition: background 0.15s ease; }
.surf-chip.mm-times-btn::after { content: " ▾"; color: var(--faint); font-size: 9px; }
.surf-chip.mm-times-btn:hover,
.surf-chip.mm-times-btn:focus-visible,
.surf-chip.mm-times-btn.open { background: rgba(255, 255, 255, 0.14); outline: none; }
.mm-times {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  max-width: calc(100vw - 16px);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #262223;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}
.mm-times-note { margin: 0; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-times-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mm-time { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; font-size: 12px; }
.mm-time-date { color: var(--muted); white-space: nowrap; }
.mm-time-time { font-weight: 600; white-space: nowrap; }
.mm-time.pb .mm-time-date { color: var(--text); }
.mm-time.pb .mm-time-time { font-weight: 800; color: rgb(var(--pct-rgb, 232, 137, 216)); }

/* momentum: xp bar under the level, like in game */
.ksf-num.mm-level { gap: 4px; }
.mm-xp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.mm-xp-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6fb6e8, #8fd0ff);
}
.mm-playing .ksf-num-value::before { content: "● "; color: #7fd17f; }
.mm-xp-text { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* map popover: every track's pb (main, stages, bonuses) + replay links */
.mm-times.wide { min-width: min(320px, calc(100vw - 16px)); }
.mm-tracks { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mm-tracks-head { margin: 0 0 6px; font-size: 11px; color: var(--muted); }
.mm-tracks-list {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  max-height: min(42vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.mm-track {
  display: grid;
  grid-template-columns: 34px minmax(56px, auto) minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 12px;
}
.mm-track + .mm-track { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.mm-track-name { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: lowercase; }
.mm-track.main .mm-track-name { color: var(--text); }
.mm-track.bonus .mm-track-name { color: #6fb6e8; }
.mm-track-time { font-weight: 700; white-space: nowrap; }
.mm-track.main .mm-track-time { color: rgb(var(--pct-rgb, 232, 137, 216)); }
.mm-track-rank { white-space: nowrap; color: var(--text); font-size: 11px; }
.mm-track .surf-chip { padding: 1px 7px; font-size: 10px; }
.mm-replay {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 3px;
  transition: color 0.15s ease, background 0.15s ease;
}
.mm-replay:hover, .mm-replay:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.1); outline: none; }
.mm-time.lb, .mm-time.wr { margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mm-time.wr .mm-time-date { color: #f0be5a; overflow: hidden; text-overflow: ellipsis; }
.mm-time.lb + .mm-time.wr { margin-top: 0; padding-top: 3px; border-top: 0; }

/* compare */
.mm-vs-form { display: flex; gap: 8px; margin: 4px 0 10px; max-width: 520px; }
.mm-vs-input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.mm-vs-input::placeholder { color: var(--faint); }
.mm-vs-input:focus { outline: none; border-color: rgba(232, 137, 216, 0.6); background: rgba(255, 255, 255, 0.06); }
.mm-vs-go {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: rgba(232, 137, 216, 0.22);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.mm-vs-go:hover, .mm-vs-go:focus-visible { background: rgba(232, 137, 216, 0.36); outline: none; }
.mm-vs-out[hidden] { display: none; }
.mm-vs-out { display: flex; flex-direction: column; gap: 4px; }
.mm-vs-matches { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-vs-match {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mm-vs-match:hover, .mm-vs-match:focus-visible { background: rgba(255, 255, 255, 0.1); outline: none; }
.mm-vs-match-pic { width: 24px; height: 24px; border-radius: 5px; }
.mm-vs-match-name { font-weight: 700; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-vs-match-id { color: var(--faint); font-size: 10px; }
.mm-vs-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.mm-vs-pic { width: 44px; height: 44px; border-radius: 8px; flex: none; }
.mm-vs-who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mm-vs-name { font-size: 15px; font-weight: 800; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.mm-vs-name:hover, a.mm-vs-name:focus-visible { text-decoration: underline; }
.mm-vs-sub { font-size: 11px; color: var(--muted); }
.mm-vs-who .more { margin: 0; flex: none; }
.mm-vs-score { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 2px 0 4px; }
.mm-vs-side { display: flex; flex-direction: column; gap: 2px; min-width: 64px; }
.mm-vs-side.them { align-items: flex-end; text-align: right; }
.mm-vs-count { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mm-vs-side.me .mm-vs-count { color: #e889d8; }
.mm-vs-side.them .mm-vs-count { color: #6fb6e8; }
.mm-vs-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.mm-vs-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.mm-vs-fill { flex-basis: 0; min-width: 3px; }
.mm-vs-fill.me { background: #e889d8; }
.mm-vs-fill.tie { background: rgba(255, 255, 255, 0.3); }
.mm-vs-fill.them { background: #6fb6e8; }
.surf-chip.mm-vs-time { color: var(--muted); }
.surf-chip.mm-vs-time.win { color: var(--text); }
.mm-vs-time-who { margin-right: 6px; font-size: 9px; color: var(--faint); }
.surf-chip.mm-vs-play { cursor: pointer; transition: color 0.15s, background 0.15s; }
.surf-chip.mm-vs-play:hover, .surf-chip.mm-vs-play:focus-visible { color: var(--text); background: var(--accent-soft, rgba(255,255,255,0.12)); }
.surf-chip.mm-vs-diff.me { background: rgba(232, 137, 216, 0.24); }
.surf-chip.mm-vs-diff.them { background: rgba(111, 182, 232, 0.22); }
.mm-vs-them { display: flex; flex-direction: column; }
.mm-vs-all .more { margin: 8px 0 4px; }
#mm-vs-title, #mm-pb-title { scroll-margin-top: 16px; }

/* searchable map box (search my maps / find your pbs): suggestions pop up as you type */
.mm-find { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; }
.mm-find-field { position: relative; max-width: 520px; }
.mm-find-input { width: 100%; box-sizing: border-box; }
.mm-find-sug {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  margin: 0;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #262223;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.mm-find-sug[hidden] { display: none; }
.mm-find-opt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.mm-find-opt[aria-selected="true"], .mm-find-opt:hover { background: rgba(255, 255, 255, 0.08); }
.mm-find-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mm-find-name b { color: var(--text); font-weight: 800; }
.mm-find-meta { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mm-find-none { padding: 6px 8px; font-size: 12px; color: var(--faint); }
.mm-find-result:empty { display: none; }
.mm-find-result { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.mm-find-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.mm-times.mm-find-box { position: static; z-index: auto; box-shadow: none; background: rgba(255, 255, 255, 0.03); flex: 1 1 260px; min-width: 0; }
.mm-times.mm-find-box.wide { min-width: 0; }
.mm-find-close { align-self: flex-start; margin: 0; }
.mm-find-box .mm-track { grid-template-columns: 30px auto minmax(0, 1fr) auto auto; }
#mm-find-title { scroll-margin-top: 16px; }

/* replay finder: any map's leaderboard, a row plays that run */
.rf-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.rf-map-field { flex: 1 1 220px; min-width: 0; max-width: none; }
.rf-who { flex: 1 1 200px; }
.rf-out[hidden] { display: none; }
.rf-out { display: flex; flex-direction: column; gap: 6px; }
.rf-out[aria-busy="true"] .rf-board { opacity: 0.55; }
.rf-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.rf-pic { width: 88px; height: 50px; border-radius: 6px; object-fit: cover; flex: none; }
.rf-head-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rf-track {
  flex: none;
  max-width: 45%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #262223;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.rf-out .rf-status { margin: 2px 0 0; }
.rf-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; transition: opacity 0.15s; }
.rf-run { display: flex; align-items: stretch; gap: 2px; }
.rf-run.top10 { box-shadow: 0 2px 0 rgba(232, 137, 216, 0.5); padding-bottom: 2px; margin-bottom: 2px; }
.rf-play {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 3.2em 26px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.rf-play:hover, .rf-play:focus-visible { background: rgba(232, 137, 216, 0.16); outline: none; }
.rf-rank { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.rf-run.wr .rf-rank, .rf-run.wr .rf-gap { color: #f0be5a; font-weight: 800; }
.rf-avatar { width: 26px; height: 26px; border-radius: 5px; grid-column: 2; background: rgba(255, 255, 255, 0.06); }
.rf-name { grid-column: 3; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-gap { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.rf-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 5.5em; text-align: right; }
.rf-file {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}
.rf-file:hover, .rf-file:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.1); outline: none; }
.rf-pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.rf-page-btn {
  padding: 4px 9px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.rf-page-btn:hover:not(:disabled), .rf-page-btn:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.rf-page-btn:disabled { opacity: 0.35; cursor: default; }
.rf-page {
  width: 4.5em;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  text-align: center;
}
.rf-all { align-self: flex-start; margin: 2px 0 0; }
@media (max-width: 520px) {
  .rf-play { grid-template-columns: 2.4em 22px minmax(0, 1fr) auto; gap: 7px; }
  .rf-avatar { width: 22px; height: 22px; }
  .rf-gap { display: none; }
  .rf-pic { width: 64px; height: 36px; }
  .rf-head { flex-wrap: wrap; }
  .rf-track { max-width: 100%; flex: 1 1 100%; }
}
.surf-copy-link {
  margin-left: 6px;
  padding: 2px 7px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.surf-copy-link:hover, .surf-copy-link:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.12); outline: none; }
@media (max-width: 520px) {
  .mm-track { grid-template-columns: 30px auto minmax(0, 1fr) auto 18px; gap: 6px; }
}

/* momentum: replay viewer (▶ next to a replay's ↓) */
.mm-replay-wrap { display: inline-flex; gap: 1px; align-items: center; }
button.mm-replay { border: 0; background: none; font: inherit; font-size: inherit; cursor: pointer; line-height: inherit; }
.mm-replay-play { color: rgb(var(--pct-rgb, 232, 137, 216)); }
body.rv-open { overflow: hidden; }
.rv-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center;
  padding: max(16px, 4vh) 16px 16px; background: rgba(0, 0, 0, 0.6); overflow-y: auto;
}
.rv {
  position: relative; width: 100%; max-width: 720px; padding: 18px 18px 14px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1); background: #262223; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  font-variant-numeric: tabular-nums;
}
.rv-close {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font: inherit; font-size: 20px; cursor: pointer;
}
.rv-close:hover, .rv-close:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.08); outline: none; }
.rv-head { padding-right: 36px; }
.rv-map { margin: 0; font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.rv-sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.rv-share { margin-top: 6px; padding: 2px 8px; font: inherit; font-size: 11px; color: var(--muted); background: none; border: 1px solid currentColor; border-radius: 6px; cursor: pointer; }
.rv-share:hover, .rv-share:focus-visible { color: var(--text); }
.rv-ingame { margin: 0 2px; padding: 0 6px; text-decoration: none; display: inline-block; }
.rv-ingame-tip { display: block; margin-top: 4px; }
.rv-swap { display: inline-block; text-decoration: none; }
.rv-retry { margin-top: 0; color: var(--text); }
.rv-note { margin: 12px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.rv-note.bad { color: #ff8f8f; font-size: 12px; }
.rv-note a { color: var(--text); }
.rv-controls { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rv-play {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px;
  background: rgb(var(--pct-rgb, 232, 137, 216)); color: #1b1a1b; font-weight: 800;
}
.rv-play:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
/* (waiting for the map to finish loading) */
.rv-play:disabled { cursor: progress; opacity: .5; animation: rv-loading 1.2s ease-in-out infinite alternate; }
@keyframes rv-loading { to { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rv-play:disabled { animation: none; } }
.rv-bar { flex: 1; min-width: 0; accent-color: rgb(var(--pct-rgb, 232, 137, 216)); }
/* the timeline's marks: a tick under it per checkpoint (taller per stage), green ahead of the wr /
   red behind. 8px in from each end, where the range's thumb centre stops */
.rv-bar-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.rv-marks { position: absolute; inset: 0; pointer-events: none; }
.rv-mark {
  position: absolute; top: calc(50% + 8px); left: calc(8px + var(--p) * (100% - 16px)); width: 2px; height: 4px; margin-left: -1px;
  border-radius: 1px; background: rgba(255, 255, 255, 0.5);
}
.rv-mark.rv-mark-stage { height: 7px; }
.rv-mark.rv-ahead { background: #7fd6a8; }
.rv-mark.rv-behind { background: #ff8f8f; }
.rv-time { flex: none; font-size: 13px; white-space: nowrap; }
.rv-clock { font-weight: 800; }
.rv-clock-end { color: var(--muted); }
.rv-rate { flex: none; background: #1b1a1b; color: var(--text); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 6px; font: inherit; font-size: 12px; padding: 3px 4px; }
.rv-live { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rv-live-cell { flex: 1 1 120px; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.rv-live-label { font-size: 10px; color: var(--muted); }
.rv-live-val { font-size: 16px; font-weight: 800; }
.rv-ahead { color: #7fd6a8; }
.rv-behind { color: #ff8f8f; }
.rv-graph { display: block; width: 100%; height: auto; margin-top: 12px; cursor: pointer; overflow: visible; }
.rv-grid { stroke: rgba(255, 255, 255, 0.07); }
.rv-axis { fill: var(--faint); font-size: 9px; font-family: inherit; }
.rv-line { fill: none; stroke: rgb(var(--pct-rgb, 232, 137, 216)); stroke-width: 2; stroke-linejoin: round; }
.rv-line-wr { fill: none; stroke: #f0be5a; stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.8; }
.rv-dot { fill: #262223; stroke: rgb(var(--pct-rgb, 232, 137, 216)); stroke-width: 2; }
.rv-dot.done { fill: rgb(var(--pct-rgb, 232, 137, 216)); }
.rv-end { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 2 3; }
.rv-head-line { stroke: var(--text); stroke-width: 1.5; }
.rv-table-box { margin-top: 12px; max-height: min(40vh, 340px); overflow: auto; border-radius: 8px; }
.rv-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rv-table th { position: sticky; top: 0; background: #262223; text-align: right; font-weight: 400; color: var(--muted); padding: 4px 8px; font-size: 11px; }
.rv-table td { text-align: right; padding: 4px 8px; white-space: nowrap; color: var(--muted); }
.rv-table th:first-child, .rv-table td:first-child { text-align: left; }
.rv-table tbody tr { cursor: pointer; }
.rv-table tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
.rv-table tr.done td { color: var(--text); }
.rv-table tr.done td.rv-dim { color: var(--muted); }
.rv-table tr.done td.rv-ahead { color: #7fd6a8; }
.rv-table tr.done td.rv-behind { color: #ff8f8f; }
.rv-table tr.now td { background: rgba(var(--pct-rgb, 232, 137, 216), 0.14); }
.rv-cp { font-weight: 700; }
.rv-finish td { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.rv-totals { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 520px) {
  .rv { padding: 14px 12px 12px; }
  .rv-controls { flex-wrap: wrap; }
  .rv-bar-wrap { order: 5; flex-basis: 100%; }
  .rv-table th, .rv-table td { padding: 4px 5px; }
}

/* 3D replay viewer */
.rv.rv-wide { max-width: 1100px; }
.r3-stage {
  --accent: rgb(var(--pct-rgb, 232, 137, 216));
  position: relative; isolation: isolate; display: grid; grid-template-areas: "scene" "controls" "options";
  grid-template-columns: minmax(0, 1fr); margin-top: 12px; overflow: hidden; border-radius: 10px;
  background: #171519; color: #f7f3f7; user-select: none; -webkit-user-select: none;
}
.r3-scene { position: relative; grid-area: scene; width: 100%; aspect-ratio: 16 / 9; max-height: 67vh; overflow: hidden; }
.r3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y pinch-zoom; }
.r3-free .r3-canvas { cursor: grab; touch-action: none; }
.r3-free .r3-canvas:active { cursor: grabbing; }
.r3-hud { position: absolute; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.r3-stage [hidden] { display: none !important; }
.r3-info {
  position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 6px 11px;
  background: rgba(18, 17, 22, .87); border-left: 3px solid var(--accent); border-radius: 2px 6px 6px 2px;
}
.r3-info-time { font-size: clamp(15px, 2vw, 21px); line-height: 1.18; font-weight: 750; white-space: nowrap; }
.r3-info-vs, .r3-info-zone { margin-top: 3px; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.r3-info-zone { color: #e5dce6; }
.r3-info-vs { color: #f4cf8a; }
.r3-gap { font-weight: 800; }
.r3-gap.ahead { color: #8ee6a8; }
.r3-gap.behind { color: #ff9a9a; }
.r3-info-vs:empty, .r3-info-zone:empty { display: none; }
/* the world record ghost's name tag, moved over its head each frame */
.r3-tag {
  position: absolute; left: 0; top: 0; display: flex; align-items: baseline; gap: 6px; padding: 2px 7px;
  border-radius: 5px; background: rgba(18, 17, 22, .78); border: 1px solid rgba(244, 207, 138, .55);
  color: #f4cf8a; font-size: 11px; font-weight: 650; line-height: 1.3; white-space: nowrap; will-change: transform, opacity;
}
.r3-tag .r3-gap:empty { display: none; }
.r3-cross { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); }
.r3-cross::before, .r3-cross::after { content: ""; position: absolute; background: #a7ffa7; box-shadow: 0 0 2px #000; }
.r3-cross::before { left: 5px; width: 2px; height: 12px; }
.r3-cross::after { top: 5px; height: 2px; width: 12px; }
.r3-speed {
  position: absolute; left: 50%; top: 68%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; line-height: 1; color: white;
  text-shadow: 0 1px 3px #141014, 0 0 6px #141014; font-weight: 800; font-size: clamp(21px, 3vw, 34px);
}
.r3-speed-unit { margin-top: 2px; font-size: 10px; font-weight: 600; letter-spacing: .09em; color: white; }
.r3-speed.gain { color: #83dcff; }
.r3-speed.loss { color: #ffb37e; }
.r3-keys {
  position: absolute; left: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(3, 28px);
  grid-template-areas: ". w ." "a s d" "j j j"; gap: 3px;
}
.r3-key {
  display: grid; place-items: center; height: 22px; border-radius: 4px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(17, 16, 21, .8); color: #d4cbd4; font-size: 11px; line-height: 1; font-weight: 650;
}
.r3-key.on { color: #211820; background: #f1c5e8; border-color: #ffe6f9; }
.r3-key.w { grid-area: w; } .r3-key.a { grid-area: a; } .r3-key.s { grid-area: s; }
.r3-key.d { grid-area: d; } .r3-key.j { grid-area: j; }
.r3-sync {
  grid-area: y; display: flex; align-items: center; justify-content: center; gap: 3px; height: 22px; border-radius: 4px;
  background: rgba(17, 16, 21, .8); border: 1px solid rgba(255,255,255,.22); color: #d4cbd4; font-size: 11px; font-weight: 600;
}
.r3-sync b { color: white; font-weight: 800; }
/* with the real buttons: Momentum's walk / duck / keyboard-turn keys around WASD, like ksf's panel */
.r3-keys.r3-keys-full {
  grid-template-columns: repeat(4, 34px);
  grid-template-areas: "y y y y" "walk . w ." "duck a s d" "j j j j" "left left right right";
}
.r3-keys:not(.r3-keys-full) { grid-template-areas: "y y y" ". w ." "a s d" "j j j"; }
.r3-key.duck { grid-area: duck; } .r3-key.walk { grid-area: walk; }
.r3-key.left { grid-area: left; } .r3-key.right { grid-area: right; }
.r3-note {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); max-width: 90%; width: max-content;
  font-size: 12px; text-align: center; padding: 6px 10px; border-radius: 6px; background: rgba(18,17,22,.84);
}
.r3-note:empty { display: none; }
.r3-stage .rv-controls {
  grid-area: controls; touch-action: manipulation; margin: 0; padding: 5px 10px; display: grid; align-items: center; gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto auto; grid-template-areas: "play step bar time rate rec options full";
  border-top: 1px solid #413743; background: #1d1a20;
}
.r3-stage .rv-play { grid-area: play; width: 36px; height: 36px; color: #281d27; background: var(--accent); }
.r3-stage .rv-step { grid-area: step; display: flex; gap: 4px; }
.r3-stage .rv-step-btn { min-width: 30px; padding: 0 6px; font-size: 16px; line-height: 1; }
.r3-stage .rv-bar-wrap { grid-area: bar; width: 100%; }
.r3-stage .rv-bar { width: 100%; height: 32px; margin: 0; cursor: pointer; }
.r3-stage .rv-time { grid-area: time; font-size: 12px; text-align: right; }
.r3-stage .rv-clock-end { color: #c6bbc8; }
.r3-stage .rv-rate { grid-area: rate; }
.rv-options { grid-area: options; }
.rv-full { grid-area: full; }
.rv-break { display: none; }
.rv-rec { grid-area: rec; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff6b7a; }
.rv-rec.on { border-color: #ff6b7a; background: #4a2430; }
.rv-rec.on::before { border-radius: 1px; animation: rv-rec 1s steps(2, jump-none) infinite; }
@keyframes rv-rec { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rv-rec.on::before { animation: none; } }
.r3-stage .rv-rate, .rv-icon {
  min-height: 34px; padding: 0 8px; font: inherit; font-size: 12px; cursor: pointer;
  border-radius: 6px; border: 1px solid #594e5b; background: #2c262f; color: #f7f3f7;
}
.rv-icon:hover, .rv-icon[aria-expanded="true"] { background: #463747; border-color: #987b99; }
.r3-stage :is(button, select, .rv-bar):focus-visible, .r3-opt input:focus-visible + .r3-switch {
  outline: 2px solid #f6d6f0; outline-offset: 1px;
}
.r3-menu {
  position: absolute; grid-area: scene; z-index: 1; right: 8px; bottom: 8px; width: min(255px, calc(100% - 16px));
  max-height: calc(100% - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 8px;
  border: 1px solid #574856; border-radius: 8px; background: #262129; box-shadow: 0 4px 20px #0006;
}
.r3-menu-head { padding: 3px 7px 6px; color: #ddd1dc; font-size: 12px; font-weight: 700; }
.r3-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 7px;
  min-height: 32px; position: relative; cursor: pointer; font-size: 12px; line-height: 1.3;
}
.r3-camera-help { grid-column: 1 / -1; margin: 5px 7px; font-size: 11px; line-height: 1.4; color: #c6bbc8; }
.r3-fov { flex-wrap: wrap; cursor: default; grid-column: 1 / -1; }
.r3-fov b { color: #f7f3f7; font-variant-numeric: tabular-nums; }
.r3-fov input[type="range"] { position: static; opacity: 1; width: 100%; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* the clean view: no HUD, the controls over the bottom of the picture, fading out while the pointer rests */
.r3-stage.r3-clean .r3-hud { display: none; }
.r3-stage.r3-clean .rv-controls { grid-area: scene; align-self: end; z-index: 2; border-top: 0; background: rgba(29, 26, 32, .84); transition: opacity .3s; }
.r3-stage.r3-clean .r3-menu { bottom: 56px; max-height: calc(100% - 64px); }
.r3-stage.r3-clean.r3-idle .rv-controls { opacity: 0; pointer-events: none; }
/* chase / free camera: the speed sits lower, off the player */
.r3-stage:is(.r3-chase, .r3-free) .r3-speed { top: 86%; }
.r3-stage.r3-clean.r3-idle, .r3-stage.r3-clean.r3-idle .r3-canvas { cursor: none; }
.r3-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.r3-switch { flex: none; width: 28px; height: 16px; border-radius: 999px; background: #635b66; position: relative; }
.r3-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px; border-radius: 50%; background: white; }
.r3-opt input:checked + .r3-switch { background: var(--accent); }
.r3-opt input:checked + .r3-switch::after { transform: translateX(12px); background: #261b25; }
@media (pointer: coarse), (max-width: 600px) {
  .r3-stage :is(.rv-play, .rv-icon, .rv-rate, .rv-bar), .r3-opt { min-height: 44px; min-width: 44px; }
  .rv-wide .rv-close { width: 44px; height: 44px; }
  .rv-wide .rv-head { padding-right: 42px; }
  .rv-wide .rv-head .rv-share { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 600px) {
  .rv-overlay { padding-inline: 6px; }
  .rv.rv-wide { padding: 12px 8px; }
  .r3-scene { aspect-ratio: 4 / 3; }
  .r3-info { top: 8px; left: 8px; padding: 4px 7px; }
  .r3-keys { left: 8px; bottom: 8px; grid-template-columns: repeat(3, 21px); gap: 2px; }
  .r3-key, .r3-sync { height: 16px; font-size: 9px; }
  .r3-keys.r3-keys-full { grid-template-columns: repeat(4, 26px); }
  /* two rows: the timeline, time and record; then play, ‹ ›, speed, and options / expand on the right */
  .r3-stage .rv-controls { display: flex; flex-wrap: wrap; padding: 0 8px 6px; gap: 0 5px; }
  .r3-stage .rv-bar-wrap { order: 1; flex: 1 1 0; min-width: 80px; }
  .r3-stage .rv-time { order: 2; }
  .rv-rec { order: 3; }
  .rv-break { display: block; order: 4; flex-basis: 100%; height: 0; }
  .r3-stage .rv-play { order: 5; }
  .r3-stage .rv-step { order: 6; }
  .r3-stage .rv-rate { order: 7; appearance: none; -webkit-appearance: none; width: 46px; padding: 0; text-align: center; text-align-last: center; }
  .rv-options { order: 8; margin-left: auto; }
  .rv-full { order: 9; }
  .r3-stage :is(.rv-options, .rv-full) { padding: 0 7px; }
  /* (just the dot on phones, plus the time while recording) */
  .rv-rec { justify-content: center; }
  .rv-rec:not(.on) .rv-rec-label { display: none; }
  .r3-menu {
    position: static; grid-area: options; width: 100%; max-height: none; box-shadow: none; border-radius: 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 6px; gap: 0 6px;
  }
  .r3-menu-head { grid-column: 1 / -1; }
}
.r3-stage:fullscreen, .r3-stage.r3-expanded {
  width: 100%; height: 100%; height: 100dvh; margin: 0; border-radius: 0;
  grid-template-rows: minmax(0, 1fr) auto auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.r3-stage.r3-expanded { position: fixed; inset: 0; z-index: 1; }
.r3-stage:is(:fullscreen, .r3-expanded) .r3-scene { aspect-ratio: auto; height: 100%; max-height: none; }
/* fullscreen: the timer panel and the keys grow with the screen (from their own corner), so they
   don't end up tiny on a big monitor. Phones in landscape stay as they are (not tall enough) */
.r3-stage:is(:fullscreen, .r3-expanded) .r3-info { transform: scale(var(--r3-hud, 1)); transform-origin: top left; }
.r3-stage:is(:fullscreen, .r3-expanded) .r3-keys { transform: scale(var(--r3-hud, 1)); transform-origin: bottom left; }
@media (min-height: 700px) { .r3-stage:is(:fullscreen, .r3-expanded) { --r3-hud: 1.3; } }
@media (min-height: 900px) { .r3-stage:is(:fullscreen, .r3-expanded) { --r3-hud: 1.6; } }
@media (min-height: 1300px) { .r3-stage:is(:fullscreen, .r3-expanded) { --r3-hud: 2.1; } }
@media (max-width: 600px) {
  .r3-stage:is(:fullscreen, .r3-expanded) .r3-menu { max-height: 40dvh; }
}

/* ── /info: discord, steam, telegram, email (public/info.js) ─────────── */
/* purple glass cards on a soft purple glow */
.info-page {
  --violet: #a78bfa;
  --violet-2: #c084fc;
  --pink: #f0abfc;
  --glass: rgba(24, 18, 36, 0.72);
  --glass-2: rgba(167, 139, 250, 0.07);
  --line: rgba(196, 167, 255, 0.14);
  position: relative;
  isolation: isolate; /* keeps the glow below in front of the page's background */
}
.info-page::before {
  /* the glow behind the cards */
  content: "";
  position: fixed;
  inset: -20vh -20vw;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40vw 32vw at 18% 18%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(36vw 30vw at 85% 30%, rgba(217, 70, 239, 0.14), transparent 70%),
    radial-gradient(44vw 34vw at 50% 95%, rgba(99, 102, 241, 0.16), transparent 70%);
  filter: blur(20px);
  animation: info-drift 24s ease-in-out infinite alternate;
}
@keyframes info-drift {
  to { transform: translate3d(3vw, -2vh, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .info-page::before { animation: none; } }
.info-page .title::before { color: var(--violet); }
.info-page .subtitle { color: #d8ccff; }

.info-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.info-card {
  --accent: #8b5cf6;
  position: relative;
  grid-column: 1 / -1;
  min-width: 0;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(167, 139, 250, 0.12), transparent 60%),
    linear-gradient(180deg, var(--glass-2), transparent 40%),
    var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 50px -12px rgba(76, 29, 149, 0.45), 0 4px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  isolation: isolate;
  animation: rise 0.5s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* gradient border */
.info-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(196, 167, 255, 0.55), rgba(196, 167, 255, 0.08) 35%, rgba(240, 171, 252, 0.06) 65%, rgba(240, 171, 252, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.info-card:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 24px 60px -12px rgba(124, 58, 237, 0.55), 0 4px 18px rgba(0, 0, 0, 0.35); }
.info-card.no-rise { animation: none; }
.info-card.small { grid-column: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.info-card.small.wide { grid-column: 1 / -1; }
.info-card h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

/* "discord" / "steam" / … chip, in each app's colour */
.info-label {
  --brand: var(--violet);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #fff; text-transform: lowercase;
  background: color-mix(in srgb, var(--brand) 22%, rgba(0, 0, 0, 0.35));
  border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  backdrop-filter: blur(8px);
}
.dc .info-label { --brand: #5865f2; }
.st .info-label { --brand: #66c0f4; }
.tg .info-label { --brand: #2aabee; }
.em .info-label { --brand: #c084fc; }
.info-label svg, .em-icon svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round;
}
.info-open {
  font-size: 11px; color: #d8ccff; text-decoration: none;
  padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.info-open:hover, .info-open:focus-visible { color: #fff; background: rgba(139, 92, 246, 0.35); }
.info-muted { margin: 0; font-size: 12px; color: #a99fc0; }
.info-note { margin: 0; padding: 0 18px 16px; }
.info-sub { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: #cbbcff; letter-spacing: 0.02em; }
.info-sub::before { content: "✦ "; color: var(--violet); }
.info-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06); color: var(--text); font: inherit; font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.info-btn:hover, .info-btn:focus-visible { background: rgba(167, 139, 250, 0.18); }
.info-btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7 55%, #d946ef);
  box-shadow: 0 6px 20px -6px rgba(168, 85, 247, 0.7);
}
.info-btn.primary:hover, .info-btn.primary:focus-visible { transform: translateY(-1px); box-shadow: 0 10px 26px -6px rgba(168, 85, 247, 0.85); }
.dc-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.info-card.small > .dc-top-right { position: absolute; top: 16px; right: 16px; z-index: 1; }
img.broken { visibility: hidden; }

/* discord: banner, picture with a status dot, then what i'm doing */
.dc-banner {
  position: relative;
  height: 130px;
  background: var(--accent) center / cover no-repeat;
}
.dc-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(24, 18, 36, 0.85)); }
.dc-banner.plain {
  height: 100px;
  background:
    radial-gradient(60% 120% at 20% 0%, rgba(240, 171, 252, 0.55), transparent 60%),
    radial-gradient(60% 120% at 90% 10%, rgba(99, 102, 241, 0.6), transparent 60%),
    linear-gradient(135deg, #4c1d95, #7c3aed 50%, #a21caf);
}
.dc-body { position: relative; padding: 0 18px 18px; }
.dc-top { display: flex; align-items: flex-end; gap: 12px; margin-top: -46px; margin-bottom: 10px; }
.dc-top .dc-top-right { padding-bottom: 6px; }
.dc-avatar { position: relative; flex: none; width: 92px; height: 92px; padding: 4px; border-radius: 50%; background: linear-gradient(140deg, #c4b5fd, #8b5cf6 45%, #e879f9); box-shadow: 0 8px 24px -6px rgba(139, 92, 246, 0.7); }
.dc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #1d1629; background: #1d1629; display: block; }
.dc-dot {
  position: absolute; right: 3px; bottom: 3px; width: 24px; height: 24px; border-radius: 50%;
  border: 5px solid #1d1629; background: var(--s);
}
.s-online { --s: #3ba55c; } .s-idle { --s: #faa61a; } .s-dnd { --s: #ed4245; } .s-offline { --s: #80848e; }
.dc-dot.s-online { box-shadow: 0 0 12px rgba(59, 165, 92, 0.8); }
.dc-dot.s-offline { background: #1d1629; box-shadow: inset 0 0 0 4px var(--s); }
.dc-name {
  font-size: 22px !important;
  background: linear-gradient(90deg, #fff, #e9d5ff 60%, #f5d0fe);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dc-user { margin: 2px 0 0; font-size: 12px; color: #a99fc0; }
/* profile effect (picked in /dashboard): its pictures stacked over the whole card, from the top,
   never in the way of taps */
.dc-effect-box { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: inherit; }
.dc-effect { position: absolute; left: 0; top: 0; width: 100%; height: auto; }
/* profile frame (picked in /dashboard): around the whole card, a little past its edges. The card
   sits in .dc-framed so the frame isn't cut off by the card's rounded corners; the lift on hover
   and the rise-in move both together. */
.dc-framed { --fo: 6px; position: relative; grid-column: 1 / -1; min-width: 0; container-type: inline-size; animation: rise 0.5s ease both; transition: transform 0.25s ease; }
.dc-framed.no-rise, .dc-framed .info-card { animation: none; }
.dc-framed .info-card:hover { transform: none; }
.dc-framed:hover { transform: translateY(-2px); }
.dc-frame {
  position: absolute; inset: calc(-1 * var(--fo)); z-index: 4; pointer-events: none;
  border: 0 solid transparent;
  border-image-source: var(--frame-src);
  border-image-slice: var(--ft) 0 var(--ft) 0 fill;
  border-image-width: calc(var(--ft) / var(--fw) * (100cqw + 2 * var(--fo))) 0;
  border-image-repeat: stretch;
  opacity: 0; transition: opacity 0.3s ease;
}
.dc-frame.ready { opacity: 1; }
/* a profile frame from Discord's shop (laid out in public/info.js → shopFramed): --u is one of
   the frame's units in px, the whole width being the card plus the frame's side overflow */
.dc-framed.shop { container-type: inline-size; }
.dc-sframe-in {
  --u: calc(100cqw / (var(--iw) + 2 * var(--oh)));
  position: relative; isolation: isolate;
  padding: calc(var(--ot) * var(--u)) calc(var(--oh) * var(--u)) calc(var(--ob) * var(--u));
}
.dc-sframe-in > .info-card { z-index: 1; }
.dc-sframe { position: absolute; inset: calc(var(--ot) * var(--u)) calc(var(--oh) * var(--u)) calc(var(--ob) * var(--u)); pointer-events: none; }
.dc-sframe > * { position: absolute; pointer-events: none; }
.dc-sframe .dc-sf-front { z-index: 2; }
.dc-sframe .dc-sf-back { z-index: 0; }
.dc-sf-staple { left: 50%; max-width: none; height: auto; opacity: 0; transition: opacity 0.3s ease; }
.dc-sf-staple.ready { opacity: 1; }
.dc-sf-staple.dc-sf-top { top: calc(412 * var(--u)); transform: translate(-50%, -100%); }
.dc-sf-staple.dc-sf-bottom { top: calc(100% - 212 * var(--u)); transform: translateX(-50%); }
.dc-sf-staple.dc-sf-center { top: 50%; transform: translate(-50%, -50%); }
.dc-sf-rail, .dc-sf-border { top: 0; bottom: 0; left: calc(-1 * var(--oh) * var(--u)); right: calc(-1 * var(--oh) * var(--u)); background: center top / 100% auto repeat-y; }
/* avatar decoration: over the picture, 120% of its size, like on Discord */
.dc-deco { position: absolute; left: -6%; top: -6%; width: 112% !important; height: 112% !important; border: 0 !important; border-radius: 0 !important; background: none !important; pointer-events: none; object-fit: contain; }
.dc-avatar.has-deco .dc-dot { z-index: 1; }
/* nameplate behind the name and @username */
.dc-names { position: relative; }
.dc-names.has-plate { margin: 0 -10px; padding: 6px 10px; border-radius: 10px; overflow: hidden; isolation: isolate; }
.dc-plate { position: absolute; inset: 0; z-index: -1; }
.dc-plate :is(img, video) { width: 100%; height: 100%; object-fit: cover; object-position: right center; display: block; }
.dc-plate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(29, 22, 41, 0.75), rgba(29, 22, 41, 0.15) 70%); }
/* server tag, after the name */
.dc-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 6px; vertical-align: 3px;
  border-radius: 6px; background: rgba(255, 255, 255, 0.1); color: #e9d5ff; -webkit-text-fill-color: #e9d5ff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.dc-tag-badge { width: 14px; height: 14px; }
/* pictures that open big when tapped (public/info.js zoomable) */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; }
.zoom {
  max-width: min(92vw, 1100px); max-height: 92vh; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; background: #1d1629; color: #ece5e1;
}
.zoom::backdrop { background: rgba(10, 8, 14, 0.82); }
.zoom-img { display: block; min-width: min(80vw, 400px); max-width: 100%; max-height: calc(92vh - 84px); margin: 0 auto; border-radius: 10px; object-fit: contain; }
.zoom-btns { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.dc-custom {
  display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0; padding: 6px 12px;
  border-radius: 12px 12px 12px 4px; font-size: 13px;
  background: rgba(167, 139, 250, 0.12); border: 1px solid var(--line);
}
.dc-emoji { width: 18px; height: 18px; }
.dc-status { margin: 12px 0 0; font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.dc-status > i, .st-state > i { width: 8px; height: 8px; border-radius: 50%; background: var(--s, #80848e); margin-right: 4px; flex: none; box-shadow: 0 0 8px var(--s, transparent); }
.dc-acts { display: grid; gap: 10px; margin-top: 16px; }
.dc-none { margin-top: 12px; }
.act {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
}
.act::before {
  /* the activity's picture as a soft glow behind it */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--act-bg, none) center / cover; filter: blur(30px) saturate(1.4); opacity: 0.25;
}
.act-spotify { background: linear-gradient(135deg, rgba(30, 215, 96, 0.12), rgba(139, 92, 246, 0.1)); border-color: rgba(30, 215, 96, 0.22); }
.act-pic { position: relative; flex: none; width: 76px; height: 76px; }
.act-pic.empty { border-radius: 12px; background: linear-gradient(135deg, #4c1d95, #a21caf); }
.act-img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.act-spotify .act-img { animation: info-spin-in 0.6s ease both; }
@keyframes info-spin-in { from { transform: scale(0.9) rotate(-4deg); opacity: 0; } }
.act-small {
  position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #241b33; background: #241b33;
}
.act-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.act-text > span, .act-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-text > span { color: #e4dcf5; opacity: 0.85; }
.act-verb { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--violet); font-weight: 800; }
.act-name { font-size: 15px; font-weight: 800; color: #fff; text-decoration: none; }
a.act-name:hover { text-decoration: underline; }
.act-spotify .act-verb { color: #1ed760; }
.act-time { font-size: 11px; opacity: 1 !important; color: #a99fc0 !important; }
.act-progress { margin-top: 8px; }
.act-bar { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.act-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #1ed760, #a3e635); border-radius: 5px; box-shadow: 0 0 10px rgba(30, 215, 96, 0.6); transition: width 1s linear; }
.act-times { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: #a99fc0; font-variant-numeric: tabular-nums; }

/* steam: status, numbers, then the last games played */
.st { padding: 18px; }
.st-glow {
  position: absolute; inset: -40px -40px auto; height: 240px; z-index: -1;
  background: center / cover no-repeat; filter: blur(40px) saturate(1.4); opacity: 0.4;
  mask-image: linear-gradient(#000, transparent); -webkit-mask-image: linear-gradient(#000, transparent);
}
.st-online, .st-busy, .st-away, .st-snooze { --s: #57cbde; }
.st-in-game { --s: #a3e635; }
.st-offline, .st-invisible { --s: #9ca3af; }
.st-head { display: flex; align-items: center; gap: 14px; }
.st-avatar { flex: none; width: 68px; height: 68px; padding: 3px; border-radius: 14px; background: linear-gradient(140deg, var(--s), #8b5cf6); box-shadow: 0 8px 22px -6px rgba(139, 92, 246, 0.6); }
.st-avatar img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; display: block; }
.st-who { min-width: 0; }
.st-who h2 { font-size: 20px !important; }
.st-state { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font-size: 12px; color: var(--s); }
.st-state b, .st-state [data-ago] { color: var(--s); }
.st-via { margin-left: 6px; color: var(--muted, #949ba4); opacity: .8; font-size: 11px; }
.st-gamed.st-now b { color: #a3e635; }
.st-gamed {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 5px; margin: 6px 0 0;
  font-size: 12px; color: #cbbcff;
}
.st-gamed svg { width: 12px; height: 12px; fill: none; stroke: #a78bfa; stroke-width: 1.4; stroke-linejoin: round; margin-right: 2px; }
.st-gamed b { color: #fff; }
.when { cursor: help; text-decoration: underline dotted rgba(196, 167, 255, 0.35); text-underline-offset: 3px; }
.st-invisible .st-state > i { background: none; box-shadow: inset 0 0 0 1.5px var(--s); }
.st-head .dc-top-right { align-self: flex-start; white-space: nowrap; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin-top: 18px; }
.st-tile {
  padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.16), rgba(0, 0, 0, 0.25));
  border: 1px solid var(--line);
}
.st-tile b {
  display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fff, #ddd6fe 50%, #f5d0fe);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.st-tile small { font-size: 10px; color: #a99fc0; }
.st-games { margin-top: 20px; }
.st-feature {
  position: relative; display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 460 / 160; max-height: 210px; width: 100%;
  color: var(--text); text-decoration: none; background: #241b33;
  box-shadow: 0 14px 34px -10px rgba(76, 29, 149, 0.7);
}
.st-feature-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.st-feature:hover .st-feature-art { transform: scale(1.04); }
.st-feature::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(17, 10, 30, 0.92) 0%, rgba(46, 16, 101, 0.6) 45%, transparent 80%),
    linear-gradient(0deg, rgba(76, 29, 149, 0.45), transparent 50%);
}
.st-feature-text { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.st-feature-text small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #d8b4fe; font-weight: 800; }
.st-in-game .st-feature-text small { color: var(--s); }
.st-feature-text b { font-size: clamp(17px, 3.2vw, 24px); font-weight: 800; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.st-chips span { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: rgba(76, 29, 149, 0.5); border: 1px solid rgba(216, 180, 254, 0.3); backdrop-filter: blur(6px); }
.st-list { display: grid; gap: 8px; margin-top: 10px; }
.st-game {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) 110px; gap: 12px; align-items: center;
  padding: 7px; border-radius: 14px; color: var(--text); text-decoration: none;
  background: rgba(255, 255, 255, 0.035); border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.st-game:hover, .st-game:focus-visible { background: rgba(139, 92, 246, 0.14); border-color: var(--line); transform: translateX(2px); }
.st-game-art { width: 120px; aspect-ratio: 460 / 215; border-radius: 9px; object-fit: cover; display: block; background: #241b33; }
.st-game-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.st-game-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-game-text small { font-size: 11px; color: #a99fc0; }
.st-now { color: var(--s); }
.st-game-time { display: flex; flex-direction: column; gap: 5px; padding-right: 6px; text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-game-time small { font-size: 10px; font-weight: 400; color: #a99fc0; }
.st-mini { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.st-mini i { display: block; height: 100%; margin-left: auto; background: linear-gradient(90deg, #8b5cf6, #e879f9); border-radius: 4px; box-shadow: 0 0 8px rgba(192, 132, 252, 0.6); }

/* telegram + email */
.tg::before, .em::before {
  /* a soft coloured glow in the corner */
  content: ""; position: absolute; z-index: -1; width: 220px; height: 220px; right: -70px; bottom: -90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 171, 238, 0.3), transparent 70%);
}
.em::before { background: radial-gradient(circle, rgba(217, 70, 239, 0.32), transparent 70%); }
.tg-head { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.tg-photo { flex: none; width: 68px; height: 68px; padding: 3px; border-radius: 50%; background: linear-gradient(140deg, #2aabee, #8b5cf6); box-shadow: 0 8px 22px -6px rgba(42, 171, 238, 0.6); }
.tg-photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.tg-photo.empty { display: grid; place-items: center; font-size: 26px; font-weight: 800; text-transform: uppercase; }
.tg-who { min-width: 0; }
.tg-names { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
.tg-names a { font-size: 11px; color: #bae6fd; text-decoration: none; padding: 2px 8px; border-radius: 999px; background: rgba(42, 171, 238, 0.14); border: 1px solid rgba(42, 171, 238, 0.3); }
.tg-names a:hover { background: rgba(42, 171, 238, 0.28); }
.tg-bio { margin: 0; font-size: 12px; line-height: 1.55; color: #e4dcf5; white-space: pre-line; }
.tg .info-btn, .em .em-btns { margin-top: auto; }
.tg .info-btn { align-self: flex-start; }
.em-icon {
  display: grid; place-items: center; width: 68px; height: 68px; margin-top: 26px; border-radius: 20px; color: #fff;
  background: linear-gradient(140deg, #7c3aed, #c026d3); box-shadow: 0 10px 26px -8px rgba(192, 38, 211, 0.75);
  transform: rotate(-6deg);
}
.em-icon svg { width: 28px; height: 28px; stroke-width: 1.2; }
.em-addr { margin: 0; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.em-btns { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 600px) {
  .info-cards { grid-template-columns: minmax(0, 1fr); }
  .info-card.small { grid-column: 1 / -1; }
  .dc-banner { height: 104px; }
  .st-game { grid-template-columns: 88px minmax(0, 1fr) 72px; gap: 10px; }
  .st-game-art { width: 88px; }
  .st-feature { aspect-ratio: 460 / 200; }
  .act-pic { width: 62px; height: 62px; }
}

/* /movies: the favorite film pinned in /dashboard (public/movies.js) */
.mv-fav { display: flex; gap: 14px; align-items: center; margin: 0 0 14px; padding: 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); }
.mv-fav img { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; flex: none; }
.mv-fav div { display: grid; gap: 2px; min-width: 0; }
.mv-fav b { font-size: 17px; }
.mv-fav small { color: var(--muted, #8d807c); }
