/* ============================================================
   main.css — single stylesheet for c.stupid.cat
   Merged from style.css + discord-styles.css

   Sections:
     1. Base & reset            (all pages)
     2. Shared layout & header  (all pages)
     3. Link hub                (index page)
     4. Discord widget      (shared, top-left)
     5. Page nav                (shared, bottom-left)
     6. System badges           (shared, bottom-right)
     7. Theme switcher          (shared, top-right)
     8. dev-info page
     9. Changelog page
    10. Secret cat modes        (toast + picker modal)
    11. Projects page
    12. Responsive overrides
    13. Friends Page
   ============================================================ */

@import url(/css/fonts.css);
@import url(/css/themes/frappe.css);
@import url(/css/themes/latte.css);
@import url(/css/themes/mocha.css);
@import url(/css/themes/macchiato.css);

/* ============================================================
   1. BASE & RESET
   ============================================================ */
* {
  box-sizing: border-box;
  cursor: url('/assets/cursor/default_0.png') 3 3, auto;
}

/* Smooth cross-fade between pages */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
}

html {
  background: linear-gradient(135deg, var(--base) 0%, var(--mantle) 60%, var(--crust) 100%);
}

body {
  font-family: 'Comic Code', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 1.5rem 1rem;
  background: linear-gradient(135deg, var(--base) 0%, var(--mantle) 60%, var(--crust) 100%);
  color: var(--text);
}


/* clickable */
a, button, [role="button"], label[for], select, summary {
  cursor: url('../assets/cursor/pointer_0.png'), pointer;
}

/* text entry / editing */
input:not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
textarea, [contenteditable="true"] {
  cursor: url('../assets/cursor/text_0.png'), text;
}

/* loading */
[aria-busy="true"], .is-loading {
  cursor: url('../assets/cursor/wait_0.png'), wait;
}

/* busy but interactive */
.is-progress {
  cursor: url('../assets/cursor/progress_0.png'), progress;
}

/* help */
[title]:not(a):not(button), .help {
  cursor: url('../assets/cursor/help_0.png'), help;
}

/* disabled */
:disabled, [disabled], [aria-disabled="true"] {
  cursor: url('../assets/cursor/not-allowed_0.png'), not-allowed;
}

/* draggable */
[draggable="true"] {
  cursor: url('../assets/cursor/openhand_0.png'), grab;
}

/* crosshair / zoom (if you use them) */
.crosshair { cursor: url('../assets/cursor/crosshair_0.png'), crosshair; }
.zoom-in   { cursor: url('../assets/cursor/zoom-in_0.png'),   zoom-in;   }
.zoom-out  { cursor: url('../assets/cursor/zoom-out_0.png'),  zoom-out;  }

/* Estrogen watermark blended into the background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url(/assets/theme/estrogen.svg) center / cover no-repeat;
  filter: invert(86%) sepia(8%) saturate(900%) hue-rotate(190deg) brightness(105%);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* Miku chibi tucked into the bottom-right corner */
body::after {
  content: "";
  position: fixed;
  right: 0.5rem;
  bottom: 0.5rem;
  width: clamp(96px, 14vw, 168px);
  aspect-ratio: 564 / 547;
  background: url(/assets/theme/miku.png) center / contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}


/* ============================================================
   2. SHARED LAYOUT & HEADER  (all pages)
   ============================================================ */
.hub {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
}

.pfp {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--yellow);
  box-shadow: 0 4px 18px rgba(245, 194, 231, 0.25);
  margin-bottom: 0.75rem;
}

.hub-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.hub-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: rgb(var(--accent-rgb));
  transition: color 0.6s ease;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--subtext-0);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pronouns {
  margin: 0.35rem 0 0;
  color: var(--mauve);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}


/* ============================================================
   3. LINK HUB  (index page)
   ============================================================ */
.links {
  display: grid;
  grid-template-columns: repeat(auto-fit, 72px);
  gap: 0.9rem;
  justify-content: center;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  background: var(--surface-1);
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.22);
}

.icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  transition: filter 0.15s ease;
}

.link-card:hover .icon {
  filter: none;
}

/* Tooltip revealed on hover */
.link-text {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: var(--crust);
  border: 1px solid rgb(var(--accent-rgb));
  box-shadow: 0 6px 18px rgba(17, 17, 27, 0.55);
  white-space: nowrap;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.link-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgb(var(--accent-rgb));
}

.link-card:hover .link-text,
.link-card:focus-visible .link-text {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.link-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.link-sub {
  font-size: 0.78rem;
  color: var(--subtext-0);
}


/* ============================================================
   5. PAGE NAV  (shared, pinned top-left)
   ============================================================ */
.nav {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 6;
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  color: var(--subtext-1);
  font-size: 0.8rem;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  border-color: rgb(var(--accent-rgb));
  color: var(--text);
  transform: translateX(2px);
}

.nav-link.selected {
  background: rgb(var(--accent-rgb));
  border-color: rgb(var(--accent-rgb));
  color: var(--crust);
  font-weight: 700;
  margin-left: 14px;
}

.nav-link.is-a-dev {
  background: var(--surface-1);
  border-color: var(--surface-2);
  color: var(--text);
}

.nav-link.is-a-dev:hover {
  border-color: var(--saphire);
  transform: translateX(2px);
}

/* Triangle pointing at the selected item */
.nav-link.selected::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgb(var(--accent-rgb));
}


/* ============================================================
   6. SYSTEM BADGES  (shared, pinned bottom-right)
   ============================================================ */
.badges {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  pointer-events: none;
  z-index: 5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-0);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: var(--subtext-1);
  font-size: 0.75rem;
  white-space: nowrap;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.badge:hover {
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 4px 14px -6px rgba(var(--accent-rgb), 0.5);
}

.badge-icon {
  width: 15px;
  height: 15px;
  filter: invert(78%) sepia(36%) saturate(640%) hue-rotate(280deg) brightness(105%);
}


/* ============================================================
   7. THEME SWITCHER  (shared, icon button top-right)
   ============================================================ */
.beta-bar {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* cat-collection button icon: the classic oneko idle frame, scaled down
   from the 256x128 sprite sheet (idle frame lives at -96px,-96px) */
.beta-cat-icon {
  width: 22px;
  height: 22px;
  display: block;
  background-image: url('/assets/oneko/classics/classic.png');
  background-repeat: no-repeat;
  background-size: 176px 88px;
  background-position: -66px -66px;
  image-rendering: pixelated;
}

.beta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 999px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.beta-btn:hover {
  border-color: var(--pink);
  transform: translateY(2px);
}

.beta-icon {
  width: 22px;
  height: 22px;
  display: block;
}


/* ============================================================
   8. dev-info PAGE
   ============================================================ */
/* Let only the dev-info page scroll; link hub stays locked */
html:has(.dev-info),
body:has(.dev-info) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}

body:has(.dev-info) {
  align-items: flex-start;
}

body:has(.dev-info) .hub {
  max-width: 860px;
}

.dev-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto;
  padding-bottom: 4.5rem;
}

/* Simple Icons rendered via CSS mask so colour is theme-driven.
   Markup: <span class="tech-icon pink" style="--si:url('https://cdn.simpleicons.org/SLUG')"></span> */
.tech-icon {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-block;
  transition: transform 0.15s ease, filter 0.15s ease;
}

/* The icon shape — masked so the label (::after) stays visible */
.tech-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: currentColor;
  -webkit-mask: var(--si) center / contain no-repeat;
  mask: var(--si) center / contain no-repeat;
}

.tech-icon:hover {
  transform: translateY(-2px) scale(1.12);
  filter: drop-shadow(0 4px 8px currentColor);
}

/* Hover label — pulls text from aria-label, tinted to match the icon */
.tech-icon::after {
  content: attr(aria-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--crust);
  border: 1px solid currentColor;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.tech-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Catppuccin accent classes — pull from the active flavour's vars */
.tech-icon.rosewater {
  color: var(--rosewater);
}

.tech-icon.pink {
  color: var(--pink);
}

.tech-icon.mauve {
  color: var(--mauve);
}

.tech-icon.red {
  color: var(--red);
}

.tech-icon.maroon {
  color: var(--maroon);
}

.tech-icon.peach {
  color: var(--peach);
}

.tech-icon.yellow {
  color: var(--yellow);
}

.tech-icon.green {
  color: var(--green);
}

.tech-icon.teal {
  color: var(--teal);
}

.tech-icon.sky {
  color: var(--sky);
}

.tech-icon.sapphire {
  color: var(--saphire);
}

.tech-icon.blue {
  color: var(--blue);
}

.tech-icon.lavender {
  color: var(--lavender);
}


/* ============================================================
   10. SECRET CAT MODES  (toast + picker modal)
   ============================================================ */
.cat-toast {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%) translateY(8px);
  z-index: 2147483647;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--crust);
  border: 1px solid var(--pink);
  color: var(--text);
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cat-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cat-picker {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 17, 27, 0.65);
  backdrop-filter: blur(2px);
}

.cat-picker[hidden] {
  display: none;
}

.cat-picker-panel {
  width: min(94vw, 430px);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--base);
  border: 1px solid var(--surface-1);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.cat-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-weight: 700;
  color: var(--pink);
}

.cat-picker-close {
  background: none;
  border: none;
  color: var(--subtext-0);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.cat-picker-close:hover {
  color: var(--text);
}

.cat-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cat-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mauve);
  border-bottom: 1px solid var(--surface-1);
  padding-bottom: 0.3rem;
}

.cat-section-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.cat-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.4rem 0.6rem;
  border-radius: 12px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  color: var(--text);
  font-family: inherit;
  font-size: 0.74rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cat-option:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: var(--pink);
}

.cat-option.current {
  border-color: var(--pink);
  box-shadow: inset 0 0 0 1px var(--pink);
}

.cat-option.locked {
  cursor: default;
  opacity: 0.75;
}

.cat-preview {
  /* 30px window + the -97px,-97px position = the idle frame inset 1px on
     every side, so no preview can catch pixels from neighbouring frames */
  width: 30px;
  height: 30px;
  margin: 7px 1px 11px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  transform: scale(1.7);
  transform-origin: center;
}

.cat-name {
  font-weight: 500;
}

.cat-hint {
  margin: 0.85rem 0 0;
  font-size: 0.68rem;
  color: var(--subtext-0);
  text-align: center;
}


/* ============================================================
   11. Projects PAGE
   ============================================================ */
/* On the projects page the header sits closer to the sections */
body:has(.project-grid) .hub-header {
  position: relative;
  z-index: 1;
  margin-bottom: 0.25rem;
}

/* FIX: project-grid and friend-grid pages need scrolling — was missing */
html:has(.project-grid),
html:has(.friend-grid) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

body:has(.project-grid),
body:has(.friend-grid) {
  height: auto;
  min-height: 100dvh;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: visible;
}

.section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mauve);
}

.section-subtitle {
  margin: -1.1rem 0 0;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--surface-2);
}

/* ---- Project cards (horizontal: avatar left, title + status + bio) ---- */
.project-grid {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 640px;
}

.project-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-3px);
  background: var(--surface-1);
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.22);
}

.project-card-img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--yellow);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.22);
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.project-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-card-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.project-card-status {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--crust);
  border: 1px solid var(--green);
  color: var(--green);
  white-space: nowrap;
}

.project-card-status.closed {
  border-color: var(--red);
  color: var(--red);
}

.project-card-bio {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--subtext-0);
}

/* Italic + dimmed until you replace it with a real description */
.project-card-bio.is-placeholder {
  font-style: italic;
  opacity: 0.65;
}


/* ============================================================
   12. RESPONSIVE OVERRIDES
   ============================================================ */

/* Shrink to fit narrow / short screens so the hub never scrolls */
@media (max-width: 420px),
(max-height: 640px) {
  .hub-header {
    margin-bottom: 1.25rem;
  }

  .hub-header h1 {
    font-size: 1.6rem;
  }

  .pfp {
    width: 72px;
    height: 72px;
    margin-bottom: 0.5rem;
  }

  .links {
    grid-template-columns: repeat(auto-fit, 60px);
    gap: 0.6rem;
  }

  .link-card {
    width: 60px;
    height: 60px;
    border-radius: 13px;
  }

  .icon {
    width: 26px;
    height: 26px;
  }
}

/* Cat picker: 2 columns on very narrow screens */
@media (max-width: 420px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile layout — single vertical scroll, stacked widgets */
@media (max-width: 640px) {

  html {
    height: auto;
    /* Single vertical scroll root on mobile; clip horizontal overflow
       so the absolutely-positioned link tooltips can't pan the page. */
    overflow-x: hidden;
    overflow-y: auto;
  }

  body,
  body:has(.dev-info),
  body:has(.project-grid),
  body:has(.friend-grid) {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
    padding: 1.25rem 1rem 2rem;
  }

  /* 1 — Top bar: the two single-item widgets, side by side */
  .topbar {
    order: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
  }

  /* FIX: the presence card injected by discord.js replaces #discord
     with .presence-card (position:fixed by default in api.css). Inside
     .topbar on mobile it must flow normally. */
  .topbar .presence-card,
  .topbar .beta-bar {
    position: static;
    inset: auto;
  }

  /* FIX: presence-card max-width so it doesn't overflow narrow screens */
  .topbar .presence-card {
    max-width: min(100%, 320px);
    width: 100%;
  }

  /* 2 — Main content */
  .hub,
  body:has(.dev-info) .hub,
  body:has(.project-grid) .hub,
  body:has(.friend-grid) .hub {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  /* 3 — Page nav as a centered group */
  .nav {
    order: 3;
    position: static;
    inset: auto;
    width: 100%;
  }

  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  /* The selected-item pointer triangle / offset only makes sense in
     the vertical desktop nav — drop it on mobile */
  .nav-link.selected {
    margin-left: 0;
  }

  .nav-link.selected::before {
    display: none;
  }

  /* 4 — System badges, centered and wrapping */
  .badges {
    order: 4;
    position: static;
    inset: auto;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    /* FIX: restore pointer-events on mobile so pokéball and badges are tappable */
    pointer-events: auto;
  }

  /* FIX: hide tooltips on touch (they'd stick on tap) */
  .link-card:hover .link-text {
    opacity: 0;
    pointer-events: none;
  }

  .hub-header {
    margin-bottom: 1.5rem;
  }

  /* Keep the dev-info / projects / friends content from butting up
     against the nav below it */
  .dev-info,
  .project-grid,
  .friend-grid {
    padding-bottom: 1rem;
  }

  /* FIX: bot sections need a bit of breathing room */
  .section+.section {
    margin-top: 1.5rem;
  }

  /* FIX: narrow waka bar label column so bars aren't crushed */
  .waka-bar-row {
    grid-template-columns: 5rem 1fr auto;
  }

  /* FIX: terminal height — respect short landscape viewports */
  .terminal {
    width: 94vw;
    height: clamp(300px, 65dvh, 70vh);
  }
}

/* Very narrow phones — squeeze waka bar name column further */
@media (max-width: 380px) {
  .waka-bar-row {
    grid-template-columns: 4rem 1fr auto;
    gap: 0.4rem;
  }

  .waka-bar-val {
    font-size: 0.66rem;
  }

  /* Single column + slightly smaller avatars on very small screens */
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card-img {
    width: 48px;
    height: 48px;
  }
}


/* ============================================================
   12. HIDDEN POKÉBALL  (unlocks the Pokémon cats once clicked)
   ============================================================ */
/* Small, low-contrast and tucked among the badges so it has to be
   hunted for. Still clickable — that's the whole point of finding it. */
#pokeball-secret {
  width: 14px;
  height: 14px;
  opacity: 0.18;
  align-self: center;
  cursor: default;
  pointer-events: auto;
  /* parent .badges sets none — re-enable here */
  image-rendering: auto;
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-user-drag: none;
  user-select: none;
}

#pokeball-secret:hover {
  opacity: 0.85;
  transform: scale(1.15);
}

#pokeball-secret.found {
  opacity: 1;
  cursor: default;
  filter: drop-shadow(0 0 4px var(--red));
}


/* ============================================================
   12. dev-info / Dev Info PAGE
   ============================================================ */
/* Let the coding-stats page scroll; link hub stays locked */
html:has(.waka),
body:has(.waka) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}

body:has(.waka) {
  align-items: flex-start;
}

.waka {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 4.5rem;
}

.waka .hub-header {
  margin-bottom: 1.5rem;
}

.waka-meta {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--subtext-0);
}

.waka-section {
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  border-radius: 16px;
  padding: 0.85rem 1.25rem 0.95rem;
  margin-bottom: 0.7rem;
}

.waka-section .section-title {
  text-align: left;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

/* ---- headline total + weekly chart ---- */
.waka-total {
  text-align: center;
}

.waka-total-num {
  font-size: 2.1rem;
  font-weight: 700;
  color: rgb(var(--accent-rgb));
  line-height: 1.1;
}

.waka-total-sub {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext-0);
  margin-bottom: 1.1rem;
}

.waka-week {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 120px;
}

.waka-day {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
}

.waka-day-track {
  flex: 1;
  width: 100%;
  max-width: 34px;
  display: flex;
  align-items: flex-end;
  background: var(--surface-1);
  border-radius: 7px;
  overflow: hidden;
}

.waka-day-fill {
  width: 100%;
  min-height: 3px;
  background: rgb(var(--accent-rgb));
  border-radius: 7px 7px 0 0;
  transition: height 0.5s ease;
}

.waka-day-label {
  font-size: 0.66rem;
  color: var(--subtext-0);
}

/* ---- ranked horizontal bars (languages / projects / editors / os) ---- */
.waka-bars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.waka-bar-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  align-items: center;
  gap: 0.7rem;
}

.waka-bar-name {
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waka-bar-track {
  height: 9px;
  background: var(--surface-1);
  border-radius: 999px;
  overflow: hidden;
}

.waka-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: rgb(var(--accent-rgb));
  border-radius: 999px;
  transition: width 0.6s ease;
}

.waka-bar-val {
  font-size: 0.74rem;
  color: var(--subtext-0);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- two-up grid for editors + OS on wider screens ---- */
.waka-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.waka-grid2 .waka-section {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .waka-grid2 {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .waka-grid2 .waka-section {
    margin-bottom: 1.1rem;
  }

  .waka-bar-row {
    grid-template-columns: 5.5rem 1fr auto;
  }
}

/* ---- empty / setup state ---- */
.waka-empty {
  font-size: 0.85rem;
  color: var(--subtext-0);
  line-height: 1.5;
  margin: 0;
}

.waka-setup {
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  border-radius: 16px;
  padding: 1.25rem 1.4rem 1.5rem;
  text-align: left;
}

.waka-steps {
  margin: 0.9rem 0 1.2rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

.waka-steps code {
  background: var(--surface-1);
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.waka-steps a,
.waka-empty a,
.waka-credit a {
  color: rgb(var(--accent-rgb));
  text-decoration: none;
}

.waka-steps a:hover,
.waka-empty a:hover,
.waka-credit a:hover {
  text-decoration: underline;
}

.waka-setup-btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgb(var(--accent-rgb));
  color: var(--crust);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.waka-setup-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.waka-credit {
  text-align: center;
  font-size: 0.72rem;
  color: var(--subtext-0);
  margin: 1.4rem 0 0;
}

/* ---- collapsible dropdown sections (details/summary) ---- */
details.waka-section {
  /* keep the card padding tight when collapsed; expands via [open] below */
  padding-bottom: 0.85rem;
  transition: padding-bottom 0.15s ease;
}

details.waka-section[open] {
  padding-bottom: 1.15rem;
}

/* The clickable header row */
summary.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
  transition: margin-bottom 0.15s ease, color 0.15s ease;
}

/* Hide the native disclosure triangle (both engines) */
summary.section-title::-webkit-details-marker {
  display: none;
}

summary.section-title::marker {
  content: "";
}

summary.section-title:hover {
  color: rgb(var(--accent-rgb));
}

summary.section-title:focus-visible {
  outline: 2px solid rgb(var(--accent-rgb));
  outline-offset: 3px;
  border-radius: 6px;
}

/* Custom chevron that flips when the section is open */
summary.section-title::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.15rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details.waka-section[open]>summary.section-title {
  margin-bottom: 0.75rem;
}

details.waka-section[open]>summary.section-title::after {
  transform: rotate(-135deg);
}

/* Tech-stack icons sit inside a collapsible card now: drop the big
   page-bottom padding the standalone .dev-info block used. */
.tech-stack .dev-info {
  padding-bottom: 0;
  justify-content: flex-start;
}

/* ---- about / setup + badges section ---- */
.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* The .badge chips are reused here in normal page flow (the fixed-position
   .badges container is gone); make sure they stay interactive + visible. */
.about-badges .badge {
  pointer-events: auto;
}

.about-list {
  margin-top: 0.25rem;
}

/* hidden pokéball now lives inside the dev-info Setup section */
.about-setup #pokeball-secret {
  display: block;
  margin: 0.9rem auto 0;
}

/* ---- hardware spec list ---- */
.hw-item {
  text-decoration: none;
  color: var(--text);
}

.hw-intro {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  color: var(--subtext-0);
}

.hw-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
}

.hw-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.7rem;
  align-items: baseline;
}

.hw-row dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext-0);
}

.hw-row dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
}

@media (max-width: 560px) {
  .hw-row {
    grid-template-columns: 6rem 1fr;
  }
}


/* ============================================================
   14. TERMINAL HOMEPAGE  (+ 88x31 button wall)
   ============================================================ */
.terminal {
  position: relative;
  z-index: 1;
  width: min(92vw, 600px);
  /* locked height — the box must not resize between boot and ready, or as
     command output is appended (the inner .t-output scrolls instead) */
  height: min(62vh, 460px);
  display: flex;
  flex-direction: column;
  padding: 1rem 1.15rem 1.15rem;
  background: var(--mantle);
  border: 1px solid var(--surface-1);
  border-radius: 14px;
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
  font-family: 'Comic Code', ui-monospace, 'JetBrains Mono', Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  overflow: hidden;
  /* lets .t-banner size itself off the terminal's width (cqw), not the
     viewport, so the ascii always fits regardless of the loaded font */
  container-type: inline-size;
}

body:has(.terminal) .hub {
  max-width: min(92vw, 600px);
  width: 100%;
}

body:has(.terminal) .hub .terminal {
  width: 100%;
  margin: 0 auto;
}

/* ---- boot log ---- */
.t-boot {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  color: var(--subtext-0);
  max-height: 72vh;
  overflow: hidden;
}

.t-boot[hidden] {
  display: none;
}

.b-line {
  display: block;
}

.b-time {
  color: var(--overlay-0);
}

.b-info {
  color: var(--blue);
  font-weight: 700;
}

.b-ok {
  color: var(--green);
  font-weight: 700;
}

/* ---- main terminal ---- */
.t-main {
  display: flex;
  flex-direction: column;
  flex: 1;          /* fill the fixed-height terminal so .t-output scrolls */
  min-height: 0;
}

.t-main[hidden] {
  display: none;
}

.t-banner {
  margin: 0 0 0.5rem;
  color: rgb(var(--accent-rgb));
  /* scale to the terminal's width (1cqw = 1% of it) so the 42-char banner
     always fits; capped so it never gets oversized on a wide terminal */
  font-size: min(0.78rem, 1.9cqw);
  line-height: 1.04;
  white-space: pre;
  overflow: hidden;
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.35);
}

.t-greet {
  margin-bottom: 0.7rem;
  color: var(--subtext-1);
}

.t-greet b {
  color: rgb(var(--accent-rgb));
}

.t-dim {
  color: var(--subtext-0);
}

.t-accent {
  color: rgb(var(--accent-rgb));
}

.t-inputline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--surface-0);
}

.t-prompt {
  color: var(--green);
  white-space: nowrap;
  font-weight: 700;
}

.t-path {
  color: var(--blue);
  font-weight: 700;
}

.t-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: rgb(var(--accent-rgb));
}

.t-output {
  margin-top: 0.6rem;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.t-echo {
  color: var(--subtext-0);
}

.t-result {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 0.15rem;
}

.t-entry.is-error .t-result {
  color: var(--red);
}

/* hyfetch trans-flag block */
.hf-c1 {
  color: #5bcefa;
}

.hf-c2 {
  color: #f5a9b8;
}

.hf-c3 {
  color: #ffffff;
}

.hf-pad {
  color: transparent;
}

/* ---- 88x31 button wall (lives on the dedicated /88x31 page) ---- */
.button-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto;
}

.button-wall a {
  display: block;
  line-height: 0;
}

.button-wall img {
  width: 132px;
  height: 46px;
  border: 1px solid var(--surface-1);
  border-radius: 2px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.button-wall a:hover img,
.button-wall img:hover {
  transform: translateY(-2px);
  border-color: rgb(var(--accent-rgb));
}

/* ---- boot reveal of side chrome (homepage terminal) ---- */
.nav,
.badges {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.term-booting .nav,
body.term-booting .badges {
  opacity: 0;
  transform: translateY(8px);
}

body.term-chrome-in .nav,
body.term-chrome-in .badges {
  opacity: 1;
  transform: none;
}

/* ---- 88x31 page: scrolls like the other content pages ---- */
html:has(.button-page),
body:has(.button-page) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}

body:has(.button-page) {
  align-items: flex-start;
}

body:has(.button-page) .hub {
  max-width: 560px;
}

.button-page {
  display: flex;
  justify-content: center;
  padding-bottom: 4.5rem;
}

@media (max-width: 640px) {
  .terminal {
    width: 94vw;
    height: clamp(300px, 65dvh, 70vh);
  }

  .button-wall {
    max-width: 100%;
  }
}


/* ---- terminal: socials list (svg icon + clickable link) ---- */
.t-socials-hint {
  margin-bottom: 0.4rem;
}

.t-socials {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.t-social {
  display: grid;
  grid-template-columns: 18px 6.5rem 6rem 1fr;
  align-items: center;
  gap: 0.55rem;
  padding: 0.22rem 0.4rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
}

.t-social:hover {
  background: var(--surface-0);
  border-color: rgba(var(--accent-rgb), 0.4);
}

.t-social-ic {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.t-social-key {
  color: rgb(var(--accent-rgb));
}

.t-social-label {
  color: var(--text);
}

.t-social-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the "Opening …" confirmation line */
.t-social-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  grid-template-columns: none;
  padding: 0;
  border: none;
}

.t-social-open:hover {
  background: transparent;
}


/* ---- terminal: ls-style socials list + social card ---- */
.t-ls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.1rem 1.2rem;
}

.t-ls-item {
  color: rgb(var(--accent-rgb));
}

.t-ls-foot {
  margin-top: 0.6rem;
}

.t-ls-foot b {
  color: var(--text);
}

.t-social-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.t-sc-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.t-sc-head .t-social-ic {
  width: 18px;
  height: 18px;
}

.t-sc-url {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.t-sc-url:hover {
  text-decoration: underline;
}

.t-sc-ask {
  margin-top: 0.2rem;
}

.t-sc-ask b {
  color: var(--text);
}

.t-social-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
}

.t-social-open .t-social-ic {
  width: 16px;
  height: 16px;
}


/* ---- hyfetch: arch logo + info, side by side ---- */
.hf {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hf-logo {
  margin: 0;
  white-space: pre;
  line-height: 1.02;
  font-size: 0.62rem;
}

.hf-info {
  margin: 0;
  white-space: pre;
}

/* ============================================================
   13. Friends Page
   ============================================================ */

body:has(.friend-grid) .hub-header {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.friend-grid {
  display: flex;
  flex-wrap: wrap;
  /* flex-wrap centres EVERY row, including a partial last row (a lone card
     sits centred rather than stuck to the left as it did with CSS grid) */
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1.1rem;
  width: 100%;
}

/* allow the cool-people page to scroll even before friends.js injects the
   .friend-grid elements that the :has() rule keys on */
html:has(.friends-wrap),
body:has(.friends-wrap) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}
body:has(.friends-wrap) {
  align-items: flex-start;
}
body:has(.friends-wrap) .hub {
  max-width: 960px;
}
#friends-root {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 4.5rem;
}

/* ---- Lanyard friend cards ---- */
.friend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 210px;
  border-radius: 14px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.friend-card:hover {
  transform: translateY(-3px);
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 8px 22px -12px rgba(var(--accent-rgb), 0.5);
}

/* Nitro profile gradient — recolours the card body (mirrors the /discord card) */
.friend-card.has-profile-grad {
  background: linear-gradient(180deg, rgb(var(--fc-grad-1-rgb)) 0%, rgb(var(--fc-grad-2-rgb)) 100%);
  border-color: rgba(var(--fc-grad-1-rgb), 0.6);
}

/* Hovered card lifts above its neighbours and lets its text un-truncate so
   long names / usernames / custom statuses expand in full instead of being
   chopped off with an ellipsis. The body becomes an absolutely-positioned
   overlay, so the card grows DOWNWARD without resizing its grid slot —
   neighbouring cards stay exactly where they are. */
/* Expansion is gated on .is-hovering (added by JS) rather than :hover so the
   card's flow height can be pinned BEFORE .fc-main is taken out of flow —
   otherwise the card collapses, the page reflows, and hover ping-pongs
   (the "vibrating page" bug). */
.friend-card.is-hovering { overflow: visible; z-index: 5; }
.friend-card.is-hovering .fc-main {
  position: absolute;
  left: 0;
  right: 0;
  top: 54px;                 /* sit directly under the banner strip */
  background: inherit;       /* carry the card surface / Nitro gradient */
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  box-shadow: 0 10px 24px -14px rgba(17, 17, 27, 0.8);
}
.friend-card.is-hovering .fc-name,
.friend-card.is-hovering .fc-user,
.friend-card.is-hovering .fc-custom-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;   /* break long unbroken usernames / handles */
}

/* banner strip — Nitro banner image / accent colour / default wash */
.fc-banner {
  height: 54px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.45), rgba(var(--accent-rgb), 0.12));
  background-size: cover;
  background-position: center;
  /* keep the banner corners rounded even on hover, when the card switches
     to overflow:visible and no longer clips them to the card radius */
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}
.friend-card.has-banner .fc-banner {
  background-size: cover;
  background-position: center;
}

.fc-main {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem 0.85rem;
}

.fc-avatar {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  margin-top: -30px;
}
.fc-pfp {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface-0);
  background: var(--surface-0);
  display: block;
}

/* avatar decoration / frame overlay (Discord cosmetic) */
.fc-deco {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.fc-deco[hidden] { display: none; }

/* status dot — colour driven by data-status on the card */
.fc-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid var(--surface-0);
  background: var(--blue);
}
.friend-card[data-status="online"]      .fc-status { background: var(--green); }
.friend-card[data-status="idle"]        .fc-status { background: var(--yellow); }
.friend-card[data-status="dnd"]         .fc-status { background: var(--red); }
.friend-card[data-status="offline"]     .fc-status { background: var(--overlay-0); }
.friend-card[data-status="unconnected"] .fc-status { background: var(--blue); }

.fc-id {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding-top: 0.1rem;
}

.fc-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.3rem;
  min-width: 0;
}
/* name claims the full first line (so a clan tag never truncates it); the
   tag chip wraps onto its own line just beneath when there isn't room */
.fc-name-row .fc-name { flex: 1 1 100%; min-width: 0; }

/* Discord server (clan) tag chip */
.fc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
  padding: 0.05rem 0.3rem;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.fc-tag[hidden] { display: none; }
.fc-tag-badge { width: 12px; height: 12px; display: block; }

.fc-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.fc-name:hover { color: rgb(var(--accent-rgb)); }

/* Nitro display-name gradient (clipped to the text). Keep the tier heart in
   ::before painted normally so it stays its solid colour. */
.fc-name.is-gradient {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.fc-name.is-gradient::before { -webkit-text-fill-color: initial; color: var(--text); }

/* tier hearts (match the old friend-name prefixes) */
.fc-name::before { content: "🩵 "; }
.fc-name.known::before { content: "💛 "; }
.fc-name.wife::before  { content: "🖤 "; }
.fc-name.close::before { content: "🤍 "; }

.fc-user {
  font-size: 0.72rem;
  color: var(--subtext-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-user:empty { display: none; }

/* custom status (Discord activity type 4) */
.fc-custom {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  font-size: 0.72rem;
  color: var(--subtext-1);
  margin-top: 0.45rem;
  min-width: 0;
  padding: 0.3rem 0.5rem;
  background: var(--surface-1);
  border-radius: 11px;
  border-top-left-radius: 4px;
}
/* Discord-style thought-bubble tail: two little circles rising to the name */
.fc-custom::before,
.fc-custom::after {
  content: "";
  position: absolute;
  background: var(--surface-1);
  border-radius: 50%;
  pointer-events: none;
}
.fc-custom::before { width: 7px; height: 7px; top: -4px;  left: 9px; }
.fc-custom::after  { width: 4px; height: 4px; top: -8px;  left: 7px; }
.fc-custom[hidden] { display: none; }
.fc-custom-emoji { width: 14px; height: 14px; display: block; flex: none; }
.fc-custom-emoji-uni { font-size: 0.8rem; line-height: 1; flex: none; }
.fc-custom-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.1rem;
}
.fc-badges:empty { display: none; }
.fc-badge { width: 16px; height: 16px; display: block; }
.fc-badge-link { display: inline-flex; line-height: 0; }

/* ---- Alts (active + dead) ---- */
.fc-name.active-alt::before { content: "🎭 "; }
.fc-name.dead-alt::before   { content: "💀 "; }

/* dead alts: banned accounts — greyed out, name struck through, no status */
.friend-card.tier-dead-alt .fc-pfp {
  filter: grayscale(1) brightness(0.6);
}
.friend-card.tier-dead-alt .fc-name {
  color: var(--overlay-1);
  text-decoration: line-through;
}
.friend-card.tier-dead-alt .fc-status { display: none; }

/* the "struck off" diagonal slash across the avatar */
.friend-card.tier-dead-alt .fc-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132%;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow: 0 0 0 2px var(--surface-0);
  pointer-events: none;
}

/* =====================================================================
 * MUSIC PAGE (/music) — merged in from music.css.
 * Hero classes are .mdc-* to avoid colliding with the .dc-* discord
 * widget already defined above. Other classes (.lyrics, .rc-*, .sec-*,
 * .top-*, .ly-*, .music-*) are unique to this page.
 * ===================================================================== */

/* Let the music page scroll; the link hub stays locked (same pattern as
   .dev-info above). Without this, html,body{overflow:hidden}
   from the homepage layout traps the page. */
html:has(.music-wrap),
body:has(.music-wrap) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}

body:has(.music-wrap) {
  align-items: flex-start;
}

.music-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.6rem 1.25rem 5rem;
  font-family: 'Comic Code', ui-monospace, monospace;
}

.music-head {
  margin: 0 0 1.6rem;
}

.music-head h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin: 0 0 0.2rem;
  color: rgb(var(--accent-rgb));
  letter-spacing: -0.02em;
  transition: color 0.5s ease;
}

.music-head p {
  margin: 0;
  color: var(--subtext-0);
  font-size: 0.95rem;
}

/* ---- now playing hero -------------------------------------------------- */
.mdc {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1.1rem;
  align-items: center;
  background: var(--mantle);
  border: 1px solid var(--surface-0);
  border-radius: 18px;
  padding: 1.1rem;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

/* a soft wash of the album accent behind the hero */
.mdc::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 0% 0%,
      rgba(var(--accent-rgb), 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#music.is-live .mdc::before {
  opacity: 1;
}

.mdc-art {
  width: 132px;
  height: 132px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-0);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mdc-art:not(.has-art) {
  display: grid;
}

.mdc-art:not(.has-art)::after {
  content: "♪";
  color: var(--overlay-0);
  font-size: 2.4rem;
  display: grid;
  place-items: center;
  height: 100%;
}

.mdc-meta {
  min-width: 0;
  position: relative;
}

.mdc-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtext-0);
  margin-bottom: 0.35rem;
}

#music.is-live .mdc-state {
  color: rgb(var(--accent-rgb));
}

.mdc-title {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.15rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mdc-title:hover {
  color: rgb(var(--accent-rgb));
}

.mdc-artist {
  display: block;
  color: var(--subtext-1);
  font-size: 0.95rem;
}

.mdc-album {
  display: block;
  color: var(--subtext-0);
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.mdc-progress {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mdc-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-0);
  overflow: hidden;
}

.mdc-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: rgb(var(--accent-rgb));
  border-radius: 999px;
  transition: width 0.4s linear;
}

.mdc-time {
  font-size: 0.72rem;
  color: var(--subtext-0);
  font-variant-numeric: tabular-nums;
}

/* ---- lyrics (the centrepiece) ------------------------------------------ */
.sec-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subtext-0);
  margin: 2.4rem 0 0.7rem;
  font-weight: 500;
}

.sec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 2.4rem 0 0.7rem;
}

.sec-row .sec-title {
  margin: 0;
}

.ly-lock {
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.28rem 0.8rem 0.28rem 0.7rem;
  background: var(--surface-0);
  color: var(--subtext-1);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

/* Spotify-style equalizer bars (replaces the old status dot) */
.ly-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 13px;
  height: 11px;
  flex-shrink: 0;
}

.ly-bars i {
  flex: 1;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  transform: scaleY(0.4);
  opacity: 0.55;
}

.ly-lock.is-locked {
  color: rgb(var(--accent-rgb));
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.1);
}

.ly-lock.is-locked .ly-bars i {
  opacity: 1;
  animation: ly-eq 0.9s ease-in-out infinite;
}

.ly-lock.is-locked .ly-bars i:nth-child(2) {
  animation-delay: 0.15s;
}

.ly-lock.is-locked .ly-bars i:nth-child(3) {
  animation-delay: 0.3s;
}

.ly-lock.is-locked .ly-bars i:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes ly-eq {

  0%,
  100% {
    transform: scaleY(0.3);
  }

  50% {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ly-lock.is-locked .ly-bars i {
    animation: none;
    transform: scaleY(0.65);
  }
}

.ly-lock:not(.is-locked):hover {
  color: var(--text);
  border-color: var(--surface-1);
}

.lyrics {
  position: relative;
  /* anchor offsetTop for the follow scroll */
  height: 340px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: var(--crust);
  border: 1px solid var(--surface-0);
  padding: 1.4rem 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-1) transparent;
  /* fade the top + bottom so lines drift in and out */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}

.lyrics::-webkit-scrollbar {
  width: 8px;
}

.lyrics::-webkit-scrollbar-thumb {
  background: var(--surface-1);
  border-radius: 999px;
}

.ly-line {
  margin: 0;
  padding: 0.32rem 0;
  font-size: 1.18rem;
  line-height: 1.4;
  color: var(--overlay-0);
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.is-synced .ly-line {
  opacity: 0.55;
}

.is-synced .ly-line.is-active {
  color: rgb(var(--accent-rgb));
  opacity: 1;
  font-weight: 700;
  transform: translateX(2px);
}

.ly-static {
  color: var(--subtext-1);
  opacity: 1;
  font-size: 1.05rem;
}

.ly-note {
  color: var(--subtext-0);
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
  padding-top: 1rem;
}

.lyrics.is-instrumental,
.lyrics.is-empty,
.lyrics.is-loading {
  display: grid;
  place-content: center;
  height: 180px;
  -webkit-mask-image: none;
  mask-image: none;
}

.lyrics.is-instrumental .ly-note {
  color: rgb(var(--accent-rgb));
  font-size: 1.2rem;
}

/* ---- recently played --------------------------------------------------- */
.recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.rc-item a {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  text-decoration: none;
  padding: 0.45rem 0.55rem;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.rc-item a:hover {
  background: var(--surface-0);
}

.rc-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-0);
}

.rc-art-blank {
  display: grid;
  place-items: center;
  color: var(--overlay-0);
  font-size: 1.1rem;
}

.rc-text {
  min-width: 0;
}

.rc-name {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-artist {
  display: block;
  color: var(--subtext-0);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rc-when,
.rc-now {
  font-size: 0.72rem;
  white-space: nowrap;
}

.rc-when {
  color: var(--subtext-0);
}

.rc-now {
  color: rgb(var(--accent-rgb));
  font-weight: 700;
}

.is-now {
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 12px;
}

.rc-note {
  color: var(--subtext-0);
  font-size: 0.86rem;
  padding: 0.6rem 0.4rem;
  line-height: 1.5;
}

.rc-note code {
  background: var(--surface-0);
  color: var(--text);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}

/* ---- top artists ------------------------------------------------------- */
.top-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-chip a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  background: var(--mantle);
  border: 1px solid var(--surface-0);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.top-chip a:hover {
  border-color: rgb(var(--accent-rgb));
}

.top-rank {
  color: rgb(var(--accent-rgb));
  font-weight: 700;
  font-size: 0.78rem;
}

.top-name {
  color: var(--text);
  font-size: 0.85rem;
}

.top-plays {
  color: var(--subtext-0);
  font-size: 0.72rem;
}

.music-back {
  display: inline-block;
  margin-top: 2.6rem;
  font-size: 0.85rem;
  color: rgb(var(--accent-rgb));
}

/* ---- responsive -------------------------------------------------------- */
@media (max-width: 560px) {
  .mdc {
    grid-template-columns: 96px 1fr;
    gap: 0.85rem;
    padding: 0.9rem;
  }

  .mdc-art {
    width: 96px;
    height: 96px;
  }

  .mdc-title {
    font-size: 1.1rem;
  }

  .lyrics {
    height: 300px;
  }

  .ly-line {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mdc-fill {
    transition: none;
  }

  .ly-line {
    transition: color 0.15s ease;
  }
}

/* ============================================================
   15. VISITOR COUNTER  (#visitor-counter)
   Fixed to top-right, below .beta-bar (theme + cat buttons).
   ============================================================ */
#visitor-counter {
  position: fixed;
  top: 4rem;
  /* clears the ~48px beta-bar + gap */
  right: 1rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#visitor-counter .vc-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--subtext-0);
  font-family: 'Comic Code', ui-monospace, monospace;
}

/* Boot reveal: fade in with the rest of the chrome */
#visitor-counter {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

body.term-booting #visitor-counter {
  opacity: 0;
  transform: translateY(8px);
}

body.term-chrome-in #visitor-counter {
  opacity: 1;
  transform: none;
}

/* Mobile: static in topbar flow */
@media (max-width: 640px) {
  #visitor-counter {
    position: static;
    margin: 0 auto;
  }

  .topbar #visitor-counter {
    order: 2;
  }
}


/* ============================================================
   16. PRESENCE CARD + /discord + /api EMBED  (merged from player.css)
   ============================================================ */
html[data-theme="mocha"] {
  color-scheme: dark;
  --rosewater: #f5e0dc; --flamingo: #f2cdcd; --pink: #f5c2e7;
  --accent-rgb: 245, 194, 231;
  --mauve: #cba6f7; --red: #f38ba8; --maroon: #eba0ac; --peach: #fab387;
  --yellow: #f9e2af; --green: #a6e3a1; --teal: #94e2d5; --sky: #89dceb;
  --saphire: #74c7ec; --blue: #89b4fa; --lavender: #b4befe;
  --text: #cdd6f4; --subtext-0: #a6adc8; --subtext-1: #bac2de;
  --overlay-0: #6c7086; --overlay-1: #7f849c; --overlay-2: #9399b2;
  --surface-0: #313244; --surface-1: #45475a; --surface-2: #585b70;
  --base: #1e1e2e; --mantle: #181825; --crust: #11111b;
}

html[data-theme="macchiato"] {
  color-scheme: dark;
  --rosewater: #f4dbd6; --flamingo: #f0c6c6; --pink: #f5bde6;
  --accent-rgb: 245, 189, 230;
  --mauve: #c6a0f6; --red: #ed8796; --maroon: #ee99a0; --peach: #f5a97f;
  --yellow: #eed49f; --green: #a6da95; --teal: #8bd5ca; --sky: #91d7e3;
  --saphire: #7dc4e4; --blue: #8aadf4; --lavender: #b7bdf8;
  --text: #cad3f5; --subtext-0: #a5adcb; --subtext-1: #b8c0e0;
  --overlay-0: #6e738d; --overlay-1: #8087a2; --overlay-2: #939ab7;
  --surface-0: #363a4f; --surface-1: #494d64; --surface-2: #5b6078;
  --base: #24273a; --mantle: #1e2030; --crust: #181926;
}

html[data-theme="frappe"] {
  color-scheme: dark;
  --rosewater: #f2d5cf; --flamingo: #eebebe; --pink: #f4b8e4;
  --accent-rgb: 244, 184, 228;
  --mauve: #ca9ee6; --red: #e78284; --maroon: #ea999c; --peach: #ef9f76;
  --yellow: #e5c890; --green: #a6d189; --teal: #81c8be; --sky: #99d1db;
  --saphire: #85c1dc; --blue: #8caaee; --lavender: #babbf1;
  --text: #c6d0f5; --subtext-0: #a5adce; --subtext-1: #b5bfe2;
  --overlay-0: #737994; --overlay-1: #838ba7; --overlay-2: #949cbb;
  --surface-0: #414559; --surface-1: #51576d; --surface-2: #626880;
  --base: #303446; --mantle: #292c3c; --crust: #232634;
}

html[data-theme="latte"] {
  color-scheme: light;
  --rosewater: #dc8a78; --flamingo: #dd7878; --pink: #ea76cb;
  --accent-rgb: 234, 118, 203;
  --mauve: #8839ef; --red: #d20f39; --maroon: #e64553; --peach: #fe640b;
  --yellow: #df8e1d; --green: #40a02b; --teal: #179299; --sky: #04a5e5;
  --saphire: #209fb5; --blue: #1e66f5; --lavender: #7287fd;
  --text: #4c4f69; --subtext-0: #6c6f85; --subtext-1: #5c5f77;
  --overlay-0: #9ca0b0; --overlay-1: #8c8fa1; --overlay-2: #7c7f93;
  --surface-0: #ccd0da; --surface-1: #bcc0cc; --surface-2: #acb0be;
  --base: #eff1f5; --mantle: #e6e9ef; --crust: #dce0e8;
}


/* =====================================================================
 * 2. STANDALONE PAGE STAGE
 *    Only the dedicated /api pages use .api-stage; it centers a single
 *    card on a Catppuccin gradient. The homepage never sets data-theme
 *    or .api-stage, so its fixed top-left card is untouched.
 * ===================================================================== */
html[data-theme] body.api-body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Comic Code', ui-monospace, system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--base) 0%, var(--mantle) 60%, var(--crust) 100%);
}

.api-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* On the stage, the card sits in flow & centered instead of fixed. */
.api-stage .presence-card {
  position: static;
  margin: 0;
  max-width: 320px;
  width: 100%;
}

.api-empty {
  text-align: center;
  color: var(--subtext-0);
  font-size: 0.9rem;
  max-width: 420px;
  line-height: 1.5;
}
.api-empty a { color: rgb(var(--accent-rgb)); }


/* =====================================================================
 * 3. PRESENCE CARD  (unified Discord-style profile pill)
 *    Lifted verbatim from main.css §13 so the card is self-contained.
 * ===================================================================== */
.presence-card {
  --dc-accent: 245, 194, 231;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 6;
  width: max-content;
  max-width: 280px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  border-radius: 16px;
  box-shadow: 0 8px 26px -12px rgba(17, 17, 27, 0.7);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.presence-card[hidden] { display: none; }

.presence-card.has-accent {
  border-color: rgba(var(--dc-accent), 0.5);
  box-shadow: 0 8px 26px -12px rgba(var(--dc-accent), 0.6);
}

/* ---- header (always visible) ---- */
.pc-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
}

.pc-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.pc-av-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  /* solid fill behind the avatar — many PFPs (incl. Clove's) are partly
     transparent, and Discord shows a solid backdrop rather than the banner. */
  background: var(--crust);
}

/* avatar decoration / frame overlay (Discord cosmetic) */
.pc-av-deco {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pc-av-deco[hidden] { display: none; }

.pc-status {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--surface-0);
  background: var(--overlay-0);
}
.presence-card[data-status="online"]  .pc-status { background: var(--green); }
.presence-card[data-status="idle"]    .pc-status { background: var(--yellow); }
.presence-card[data-status="dnd"]     .pc-status { background: var(--red); }
.presence-card[data-status="offline"] .pc-status { background: var(--overlay-0); }

.pc-id {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.pc-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgb(var(--accent-rgb));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.5s ease;
}
.pc-user {
  font-size: 0.7rem;
  color: var(--subtext-0);
  white-space: nowrap;
}
.pc-user:empty { display: none; }

/* status word (Online / Idle / Do Not Disturb / Offline) */
.pc-status-text {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--overlay-1);
}
.pc-status-text:empty { display: none; }
.pc-status-text::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: baseline;
  background: var(--overlay-0);
}
.presence-card[data-status="online"]  .pc-status-text { color: var(--green); }
.presence-card[data-status="online"]  .pc-status-text::before { background: var(--green); }
.presence-card[data-status="idle"]    .pc-status-text { color: var(--yellow); }
.presence-card[data-status="idle"]    .pc-status-text::before { background: var(--yellow); }
.presence-card[data-status="dnd"]     .pc-status-text { color: var(--red); }
.presence-card[data-status="dnd"]     .pc-status-text::before { background: var(--red); }
.presence-card[data-status="offline"] .pc-status-text { color: var(--overlay-1); }
.presence-card[data-status="offline"] .pc-status-text::before { background: var(--overlay-0); }

/* ---- expandable sections ---- */
.pc-sections {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 0.6rem 0.6rem;
  transition: opacity 0.2s ease;
}
.presence-card:not(.has-sections) .pc-sections { display: none; }

.pc-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: var(--mantle);
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.pc-row:hover,
.pc-row--stack:hover {
  border-color: rgba(var(--dc-accent), 0.55);
  transform: translateX(2px);
}

.pc-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.04rem;
  min-width: 0;
}
.pc-row-kind {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext-0);
}
.pc-row-title {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.pc-row-sub {
  font-size: 0.7rem;
  color: var(--subtext-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.pc-row-title:empty, .pc-row-sub:empty { display: none; }

.pc-row-elapsed {
  font-size: 0.62rem;
  color: var(--subtext-0);
  margin-top: 0.1rem;
}
.pc-row-elapsed:empty { display: none; }

/* artwork / icons */
.pc-art,
.pc-row-ic-img {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
}
.pc-row-ic.pc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin: 0 0.5rem;
  background: rgb(var(--accent-rgb));
}
.pc-dev .pc-row-ic.pc-dot   { background: var(--blue); border-radius: 2px; }
.pc-game .pc-row-ic.pc-dot  { background: var(--green); }
.pc-stream .pc-row-ic.pc-dot{ background: var(--mauve); }

/* custom status */
.pc-custom {
  position: relative;
  align-self: flex-start;
  background: var(--surface-1);
  border: none;
  padding: 0.5rem 0.7rem;
  gap: 0.4rem;
  align-items: flex-start;
  border-radius: 13px;
  border-top-left-radius: 4px;
  margin-top: 0.3rem;
}
/* Discord-style thought-bubble tail */
.pc-custom::before,
.pc-custom::after {
  content: "";
  position: absolute;
  background: var(--surface-1);
  border-radius: 50%;
  pointer-events: none;
}
.pc-custom::before { width: 9px; height: 9px; top: -5px;  left: 12px; }
.pc-custom::after  { width: 5px; height: 5px; top: -11px; left: 9px; }
.pc-custom:hover { transform: none; border-color: transparent; }
.pc-emoji { width: 18px; height: 18px; flex-shrink: 0; margin-top: 0.05rem; }
.pc-custom-text {
  font-size: 0.74rem;
  color: var(--subtext-0);
  max-width: 230px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* spotify progress */
.pc-spotify .pc-row-title { color: var(--green); }
.pc-progress {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
  width: 180px;
}
.pc-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-1);
  overflow: hidden;
}
.pc-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: rgb(var(--dc-accent));
}
.pc-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: var(--subtext-0);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .presence-card { max-width: calc(100vw - 2rem); }
  .api-stage .presence-card { max-width: 100%; }
}

/* ---- extended Lanyard fields ---- */
.pc-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.pc-name-row .pc-name { min-width: 0; }

/* gradient display name (display_name_styles) */
.pc-name.is-gradient {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* server tag chip (primary_guild) */
.pc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}
.pc-tag[hidden] { display: none; }
.pc-tag-badge { width: 14px; height: 14px; display: block; }

/* username + active-platform indicators */
.pc-sub-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.pc-platforms {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--subtext-0);
}
.pc-plat { width: 12px; height: 12px; display: inline-flex; }
.pc-plat svg { width: 12px; height: 12px; display: block; }

/* KV meta line (location, etc.) */
.pc-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.1rem;
  font-size: 0.66rem;
  color: var(--subtext-0);
}
.pc-meta[hidden] { display: none; }
.pc-pin { font-size: 0.7rem; line-height: 1; }

/* stacked rows (activity rows that carry buttons) */
.pc-row--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}
.pc-row-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

/* activity icon with small corner badge (assets.small_image) */
.pc-ic-wrap {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}
.pc-ic-wrap .pc-row-ic-img { width: 38px; height: 38px; }
.pc-ic-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--mantle);
  object-fit: cover;
}

/* activity buttons (labels from presence) */
.pc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pc-btn {
  font-size: 0.66rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-1);
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pc-btn:hover {
  border-color: rgb(var(--dc-accent));
  background: var(--surface-2);
}

/* profile badges */
.pc-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.pc-badges:empty { display: none; }
.pc-badge { width: 16px; height: 16px; display: block; }
.pc-badge-link { display: inline-flex; line-height: 0; }

/* wishlist star + panel */
.pc-star {
  margin-left: auto;
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--subtext-0);
  padding: 0.1rem 0.15rem;
  transition: color 0.15s ease, transform 0.15s ease;
}
.pc-star:hover { color: rgb(var(--accent-rgb)); transform: scale(1.12); }
.pc-star.on { color: var(--yellow); }

.pc-wishlist { display: none; }
.presence-card.show-wishlist .pc-wishlist {
  display: block;
  border-top: 1px solid var(--surface-1);
  margin: 0 0.6rem;
  padding: 0.6rem 0 0.7rem;
}
.pc-wishlist-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext-0);
  margin-bottom: 0.45rem;
}
.pc-wl-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
a.pc-wl-item:hover { background: var(--mantle); }
.pc-wl-ic { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.pc-wl-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pc-wl-name { font-size: 0.8rem; }
.pc-wl-type {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtext-0);
}
.pc-wl-price {
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--subtext-1);
  white-space: nowrap;
}
.pc-wl-item.is-owned { opacity: 0.5; }
.pc-wl-empty { font-size: 0.78rem; color: var(--subtext-0); margin: 0; }

/* Discord profile gradient (Catppuccin is the fallback) */
.presence-card.has-profile-grad {
  background: linear-gradient(180deg, rgb(var(--pc-grad-1-rgb)) 0%, rgb(var(--pc-grad-2-rgb)) 100%);
}
.presence-card.has-profile-grad:not(.has-accent) {
  border-color: rgba(var(--pc-grad-1-rgb), 0.6);
}
.presence-card.has-profile-grad .pc-row { background: rgba(17, 17, 27, 0.55); }


/* =====================================================================
 * 4. EXTRAS  (banner, bio, connected accounts — used on the /discord page)
 * ===================================================================== */
.pc-banner {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  margin: 0;
}
.pc-banner[hidden] { display: none; }

/* solid/accent banner fallback when there's no Nitro banner image */
.presence-card.has-banner-color::before {
  content: "";
  display: block;
  height: 64px;
  background: var(--pc-banner-color, var(--surface-1));
}

/* when a banner is present, lift the avatar up over it */
.presence-card.has-banner .pc-head,
.presence-card.has-banner-color .pc-head {
  margin-top: -22px;
}
.presence-card.has-banner .pc-avatar,
.presence-card.has-banner-color .pc-avatar {
  width: 56px;
  height: 56px;
}
.presence-card.has-banner .pc-av-img,
.presence-card.has-banner-color .pc-av-img {
  width: 56px;
  height: 56px;
  border: 3px solid var(--surface-0);
}
.presence-card.has-banner .pc-av-deco,
.presence-card.has-banner-color .pc-av-deco {
  width: 72px;
  height: 72px;
}

.pc-bio {
  margin: 0 0.7rem 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: var(--mantle);
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--subtext-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pc-bio[hidden] { display: none; }

.pc-connections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0.7rem 0.6rem;
}
.pc-connections[hidden] { display: none; }

.pc-conn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 0.66rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
a.pc-conn:hover {
  border-color: rgb(var(--accent-rgb));
  background: var(--surface-2);
}
.pc-conn-type {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.56rem;
  color: var(--subtext-0);
}
.pc-conn-check { color: var(--green); font-weight: 700; }


/* =====================================================================
 * 5. /discord PAGE STAGE  (centered, slightly wider card)
 * ===================================================================== */
html:has(.presence-stage),
body:has(.presence-stage) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}
body:has(.presence-stage) {
  padding: 0;
}
.presence-stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.presence-intro {
  text-align: center;
  margin: 0 0 1.25rem;
}
.presence-intro h1 {
  margin: 0;
  font-size: 1.8rem;
  color: rgb(var(--accent-rgb));
}
.presence-intro p {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--subtext-0);
}

/* pronouns chip (shown on the card sub-row) */
.pc-pronouns {
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--subtext-1);
  white-space: nowrap;
}
.pc-pronouns[hidden] { display: none; }


/* =====================================================================
 * 6. /discord PAGE — big "fills the page" presence card
 * ===================================================================== */
.presence-stage .presence-card {
  position: static;
  margin: 0;
  width: 100%;
  max-width: 680px;
  border-radius: 20px;
}

/* tall Nitro banner */
.presence-stage .pc-banner {
  height: 220px;
}
.presence-stage .presence-card.has-banner-color::before {
  height: 150px;
}

/* header — roomier, big overlapping avatar */
.presence-stage .pc-head {
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  align-items: flex-end;
}
/* keep the identity column bottom-aligned to the avatar's visible lower
   half, whether or not a custom-status bubble is present */
.presence-stage .presence-card.has-custom .pc-head {
  align-items: flex-end;
}
/* only the avatar pokes up into the banner; the name/identity block stays
   in the solid area below it */
.presence-stage .presence-card.has-banner .pc-head,
.presence-stage .presence-card.has-banner-color .pc-head {
  margin-top: 0;
}
.presence-stage .presence-card.has-banner .pc-avatar,
.presence-stage .presence-card.has-banner-color .pc-avatar {
  margin-top: -60px;
}
.presence-stage .pc-avatar,
.presence-stage .presence-card.has-banner .pc-avatar,
.presence-stage .presence-card.has-banner-color .pc-avatar {
  width: 120px;
  height: 120px;
}
.presence-stage .pc-av-img,
.presence-stage .presence-card.has-banner .pc-av-img,
.presence-stage .presence-card.has-banner-color .pc-av-img {
  width: 120px;
  height: 120px;
  /* solid dark plate + ring so the banner sits clearly BEHIND the avatar
     (the PFP itself is partly transparent) */
  background: var(--crust);
  border: 6px solid var(--crust);
}
.presence-stage .pc-av-deco,
.presence-stage .presence-card.has-banner .pc-av-deco,
.presence-stage .presence-card.has-banner-color .pc-av-deco {
  width: 152px;
  height: 152px;
}
.presence-stage .pc-status {
  width: 24px;
  height: 24px;
  border-width: 5px;
}

/* identity block — bigger type */
.presence-stage .pc-name { font-size: 1.5rem; }
.presence-stage .pc-user { font-size: 0.9rem; }
.presence-stage .pc-badges { margin-top: 0.3rem; }
.presence-stage .pc-badge { width: 22px; height: 22px; }

/* bio + connections — wider, padded to match */
.presence-stage .pc-bio {
  margin: 0 1.4rem 0.8rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
}
.presence-stage .pc-connections {
  margin: 0 1.4rem 0.9rem;
  gap: 0.5rem;
}
.presence-stage .pc-conn { font-size: 0.74rem; padding: 0.3rem 0.65rem; }

/* activity rows — larger artwork + text */
.presence-stage .pc-sections {
  gap: 0.6rem;
  padding: 0 1.4rem 1.1rem;
}
.presence-stage .pc-row { padding: 0.7rem 0.8rem; border-radius: 14px; }
.presence-stage .pc-art,
.presence-stage .pc-row-ic-img,
.presence-stage .pc-ic-wrap,
.presence-stage .pc-ic-wrap .pc-row-ic-img { width: 56px; height: 56px; }
.presence-stage .pc-row-title { font-size: 0.95rem; max-width: none; }
.presence-stage .pc-row-sub { font-size: 0.82rem; max-width: none; }
.presence-stage .pc-progress { width: 100%; }
.presence-stage .pc-custom-text { font-size: 0.86rem; max-width: none; }

/* wishlist + star scale up a touch */
.presence-stage .pc-star { font-size: 1.2rem; }

@media (max-width: 720px) {
  .presence-stage .presence-card { max-width: 100%; }
}
@media (max-width: 480px) {
  .presence-stage .pc-banner { height: 150px; }
  .presence-stage .pc-avatar,
  .presence-stage .presence-card.has-banner .pc-avatar,
  .presence-stage .presence-card.has-banner-color .pc-avatar { width: 92px; height: 92px; }
  .presence-stage .pc-av-img,
  .presence-stage .presence-card.has-banner .pc-av-img,
  .presence-stage .presence-card.has-banner-color .pc-av-img { width: 92px; height: 92px; }
  .presence-stage .presence-card.has-banner .pc-head,
  .presence-stage .presence-card.has-banner-color .pc-head { margin-top: 0; }
  .presence-stage .presence-card.has-banner .pc-avatar,
  .presence-stage .presence-card.has-banner-color .pc-avatar { margin-top: -46px; }
  .presence-stage .pc-name { font-size: 1.25rem; }
}

/* =====================================================================
 * lanyard.cafe keyring (webring) — embed.js injects #lc-embed with all
 * styles inline, so every override here needs !important. Re-themes the
 * default cream/brown look to Catppuccin and the site font, keeping the
 * widget floating in the bottom-left (which is otherwise empty chrome).
 * ===================================================================== */
#lc-embed {
  font-family: 'Comic Code', 'Quicksand', system-ui, sans-serif !important;
  left: 1rem !important;
  bottom: 1rem !important;
  z-index: 5 !important;
}
#lc-embed > section { margin-bottom: 0 !important; }

/* the card */
#lc-embed > section > div {
  background: var(--surface-0) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.45) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 26px -16px rgba(0, 0, 0, 0.7) !important;
}

/* prev / random / next buttons */
#lc-embed a {
  background: var(--surface-1) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease !important;
}
#lc-embed a:nth-child(1),
#lc-embed a:nth-child(3) { color: rgb(var(--accent-rgb)) !important; }
#lc-embed a:nth-child(2) { color: var(--lavender) !important; }
#lc-embed a:hover {
  background: var(--surface-2) !important;
  transform: translateY(-2px) !important;
}

/* the "you are at <url>" line */
#lc-embed p { color: var(--subtext-0) !important; }
#lc-embed p span { color: rgb(var(--accent-rgb)) !important; }

/* On mobile the body is a single flex column and every other floating
   widget (nav, badges, presence card) is reflowed into it. The keyring,
   left fixed, floated over the nav pills when scrolled to the bottom — so
   here we drop it into the column too, last and centered. */
@media (max-width: 640px) {
  #lc-embed {
    position: static !important;
    inset: auto !important;
    order: 6 !important;
    width: 100% !important;
    margin: 0 !important;
    z-index: auto !important;
    display: flex !important;
    justify-content: center !important;
  }
  #lc-embed > section > div { min-width: 0 !important; }
}

/* =====================================================================
 * fronting.js — "currently fronting" box (sits below the terminal)
 * ===================================================================== */
.fronting-card {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0.9rem auto 0;
  padding: 0.85rem 1rem;
  background: var(--mantle);
  border: 1px solid var(--surface-1);
  border-radius: 14px;
  box-shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.6);
}

.fronting-card[hidden] { display: none; }

.fr-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtext-0);
}

.fr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.55);
  animation: fr-pulse 2.4s ease-out infinite;
}

@keyframes fr-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(166, 227, 161, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(166, 227, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(166, 227, 161, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .fr-dot { animation: none; }
}

.fr-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.fr-member {
  --fr-accent: var(--pink);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  border-radius: 12px;
  background: var(--surface-0);
  border: 1px solid var(--surface-1);
  border-left: 3px solid var(--fr-accent);
  color: var(--text);
}

.fr-av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid var(--fr-accent);
  background: var(--crust);
}

.fr-av--empty { display: inline-block; }

.fr-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.fr-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr-pronouns {
  font-size: 0.74rem;
  color: var(--subtext-0);
}

.fr-empty {
  font-size: 0.82rem;
  color: var(--subtext-0);
  font-style: italic;
}


/* ============================================================
   14. Selfies page
   ============================================================ */

/* Let the gallery scroll (the default layout locks the viewport). Keyed on
   the wrapper class so it scrolls even before selfies.js injects the grid —
   mirrors the .friends-wrap rule used by the cool-people page. */
html:has(.selfies-wrap),
body:has(.selfies-wrap) {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}
body:has(.selfies-wrap) {
  align-items: flex-start;
}
body:has(.selfies-wrap) .hub {
  max-width: 960px;
}
body:has(.selfies-wrap) .hub-header {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
}

.selfie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
  width: 100%;
  margin-bottom: 1.5rem;
  padding-bottom: 4.5rem;
}

.selfie-thumb {
  margin: 0;
  padding: 0;
  border: 1px solid var(--surface-1);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-0);
  aspect-ratio: 1 / 1;
  display: block;
  transition: transform 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.selfie-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selfie-thumb:hover,
.selfie-thumb:focus-visible {
  transform: translateY(-3px);
  border-color: rgb(var(--accent-rgb));
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.22);
  outline: none;
}

.selfie-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--subtext-0);
  font-style: italic;
  padding: 3rem 1rem;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--crust) 86%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox.is-open {
  animation: lightbox-fade 0.18s ease;
}

@keyframes lightbox-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-img {
  max-width: min(92vw, 1100px);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--surface-1);
  background: color-mix(in srgb, var(--surface-0) 85%, transparent);
  color: var(--text);
  border-radius: 999px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  background: var(--surface-1);
  border-color: rgb(var(--accent-rgb));
  outline: none;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.8rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}

.lightbox-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-nav[hidden] {
  display: none;
}

/* Freeze the page behind the lightbox while it's open */
body.lightbox-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .selfie-thumb,
  .lightbox-close,
  .lightbox-nav {
    transition: none;
  }
  .lightbox.is-open {
    animation: none;
  }
  .lightbox-nav:hover {
    transform: translateY(-50%);
  }
}

@media (max-width: 560px) {
  .selfie-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
  }
  .lightbox-nav {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.6rem;
  }
}

/* ---- Captions (thumbnails + lightbox) ---- */
.selfie-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.selfie-caption {
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--subtext-0);
  overflow-wrap: anywhere;
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  max-width: min(92vw, 1100px);
}

/* leave room beneath the image for the caption line */
.lightbox-img {
  max-height: 80vh;
}

.lightbox-caption {
  margin: 0;
  text-align: center;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: min(92vw, 1100px);
  overflow-wrap: anywhere;
}

.lightbox-caption[hidden] {
  display: none;
}


/* ============================================================
   15. Cool-people friend cards — mini presence cards
   Each friend is a full presence card (built by discord.js's
   PresenceCard factory) but smaller than the big /discord one.
   The BASE .presence-card is already compact (≈280px); we just
   un-fix it from the corner so the cards tile in .friend-grid,
   and re-add the tier hearts / dead-alt treatment on pc-* markup.
   ============================================================ */
.presence-card.is-mini {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 0;
  width: 300px;            /* clearly smaller than the 680px /discord card */
  max-width: 100%;
}

/* keep things tidy at the small size */
.presence-card.is-mini .pc-banner { height: 84px; }
.presence-card.is-mini .pc-bio {
  max-height: 6.5em;
  overflow-y: auto;
}

/* the friend name can open a personal site */
.presence-card.is-mini .pc-name--link { text-decoration: none; }
.presence-card.is-mini .pc-name--link:hover { text-decoration: underline; }

/* ---- tier hearts (ported from the old .fc-name prefixes) ---- */
.presence-card.is-mini .pc-name::before { content: "🩵 "; }
.presence-card.is-mini.tier-known .pc-name::before { content: "💛 "; }
.presence-card.is-mini.tier-wife  .pc-name::before { content: "🖤 "; }
.presence-card.is-mini.tier-close .pc-name::before { content: "🤍 "; }
.presence-card.is-mini.tier-active-alt .pc-name::before { content: "🎭 "; }
.presence-card.is-mini.tier-dead-alt  .pc-name::before { content: "💀 "; }
/* gradient names clip text to transparent — keep the heart visible */
.presence-card.is-mini .pc-name.is-gradient::before {
  -webkit-text-fill-color: initial;
  color: var(--text);
}

/* ---- dead alts: greyed, struck through, no live status ---- */
.presence-card.is-mini.tier-dead-alt .pc-av-img { filter: grayscale(1) brightness(0.6); }
.presence-card.is-mini.tier-dead-alt .pc-name {
  color: var(--overlay-1);
  text-decoration: line-through;
}
.presence-card.is-mini.tier-dead-alt .pc-status { display: none; }


/* ============================================================
   16. Top artists — artist avatar in each chip (Deezer images)
   ============================================================ */
.top-chip a { align-items: center; }

.top-art {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
  color: var(--subtext-0);
  font-size: 0.95rem;
  overflow: hidden;
}

.top-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}


/* connection brand logos (replaces the old text type label) */
.pc-conn-ic {
  width: 14px;
  height: 14px;
  display: block;
  flex: none;
}
.presence-card.is-mini .pc-conn-ic { width: 13px; height: 13px; }
