: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);
}

/* ── 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-box.expanded.scrolls .recent-list { padding-bottom: 8px; }
.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;
  justify-content: center;
  margin-top: 18px;
}
.contact-pill {
  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-sub {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.surf-sub::before { content: "### "; color: var(--faint); }
.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); }
.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;
  border-radius: 999px;
  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); }
.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; }
}
.mm-stats { grid-template-columns: minmax(0, 1fr); margin-bottom: 4px; }
.mm-stats .ksf-numbers { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.surf-chip-of { color: var(--faint); font-size: 10px; }
.surf-chip.hot { background: rgba(232, 137, 216, 0.22); }

/* "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-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 img { width: 40px; height: 40px; border-radius: 6px; }
.dbd-adept.missing { color: var(--faint); }
.dbd-adept.missing img { 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-ach.missing { opacity: 0.55; }
.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-tabs { display: flex; gap: 16px; margin: 4px 0 14px; }
.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; }
}

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

#mv[hidden] { display: none; }
.movies .recent { margin-top: 28px; }
/* rows aren't links here, but 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: default; }
.mv-stars { color: var(--text); letter-spacing: 1px; }
.mv-heart { margin-left: 6px; color: #e889d8; }
.mv-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 92px;
  margin-top: 8px;
}
.mv-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}
.mv-bar-fill { width: 100%; border-radius: 3px; background: #e889d8; }
.mv-chart-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  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"
    "surf meow";
}
.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 35%, rgba(0, 0, 0, 0.6));
}
.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;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
/* 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 { 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 { 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;
}
