/* ===========================================================================
   F58m — profile website
   ---------------------------------------------------------------------------
   1.  Tokens & reset
   2.  Background
   3.  Custom cursor
   4.  Entry gate
   5.  Stage & profile card
   6.  Avatar / identity / socials
   7.  Discord widget
   8.  Music player
   9.  Floating docks (language, quick settings)
   10. Tooltips & toasts
   11. Motion
   12. Responsive
   ======================================================================== */

/* ---------------------------------------------------------------------------
   1. Tokens & reset
   ------------------------------------------------------------------------ */
:root {
  --brand: #db1009;
  --brand-soft: #fcb6b6;
  --brand-deep: #8d0a05;
  --bg: #080808;
  --text: #ffffff;
  --muted: #a1a1aa;

  --surface: rgba(12, 10, 11, 0.68);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  --card-w: 635px;
  --card-h: 686px;
  --radius-card: 26px;
  --radius-md: 16px;
  --radius-sm: 11px;

  --shadow-card: 0 32px 80px -24px rgba(0, 0, 0, 0.9), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
  --glow-brand: 0 0 36px -8px rgba(219, 16, 9, 0.55);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms var(--ease);
  --slow: 420ms var(--ease);

  --font: 'Outfit', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  pointer-events: none;
}

.flag {
  width: 15px;
  height: 10px;
  border-radius: 2px;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

::selection {
  background: rgba(219, 16, 9, 0.5);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

/* status dots ------------------------------------------------------------ */
.dot-live,
.dot-idle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.dot-live {
  background: #3ad17c;
  box-shadow: 0 0 0 3px rgba(58, 209, 124, 0.16);
  animation: pulse-live 2.6s var(--ease) infinite;
}

.dot-idle {
  background: #5b5b63;
  box-shadow: 0 0 0 3px rgba(120, 120, 130, 0.12);
}

@keyframes pulse-live {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(58, 209, 124, 0.16);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(58, 209, 124, 0.05);
  }
}

/* ---------------------------------------------------------------------------
   2. Background
   ------------------------------------------------------------------------ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.backdrop__image {
  position: absolute;
  inset: -3.5%;
  background-color: var(--bg);
  background-image: var(--bg-image, none);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* The wallpaper is the hero — keep it sharp and at full brightness.
     Readability comes from the card's own blur + the light scrim below. */
  filter: saturate(1.08) contrast(1.02);
  transform: scale(1.04) translate3d(var(--par-x, 0px), var(--par-y, 0px), 0);
}

/* Set by script.js when the wallpaper is smaller than 1280px wide — i.e. an
   animated loop. Blur hides the upscale, and the brightness cut keeps the
   card readable through bright frames the loop may contain. */
body.bg-soft .backdrop__image {
  filter: saturate(1.05) contrast(1.02) brightness(0.58) blur(2.5px);
  transform: scale(1.09) translate3d(var(--par-x, 0px), var(--par-y, 0px), 0);
  transition: transform 700ms var(--ease), opacity var(--slow);
  opacity: 0;
  will-change: transform;
}

body.bg-ready .backdrop__image {
  opacity: 1;
}

/* Just enough darkening at the very top and bottom for the floating docks
   and status pills to stay legible — the middle stays untouched. */
.backdrop__tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 8, 8, 0.4) 0%,
    rgba(8, 8, 8, 0.06) 26%,
    rgba(8, 8, 8, 0.06) 70%,
    rgba(8, 8, 8, 0.48) 100%
  );
}

.backdrop__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    130% 100% at 50% 48%,
    rgba(8, 8, 8, 0) 58%,
    rgba(5, 5, 5, 0.42) 100%
  );
}

body.bg-soft .backdrop__vignette {
  background: radial-gradient(
    120% 95% at 50% 48%,
    rgba(8, 8, 8, 0) 34%,
    rgba(5, 5, 5, 0.62) 100%
  );
}

.backdrop__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  /* Kept faint so they add depth instead of covering the wallpaper. */
  opacity: 0.14;
  pointer-events: none;
  mix-blend-mode: screen;
}

.backdrop__glow--one {
  width: 46vw;
  height: 46vw;
  left: -8vw;
  top: -10vw;
  background: radial-gradient(circle, rgba(219, 16, 9, 0.5), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.backdrop__glow--two {
  width: 40vw;
  height: 40vw;
  right: -8vw;
  bottom: -12vw;
  background: radial-gradient(circle, rgba(252, 182, 182, 0.28), transparent 68%);
  animation: drift-b 32s ease-in-out infinite alternate;
}

@keyframes drift-a {
  to {
    transform: translate3d(5vw, 4vw, 0) scale(1.12);
  }
}

@keyframes drift-b {
  to {
    transform: translate3d(-5vw, -3vw, 0) scale(1.1);
  }
}

.backdrop__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

/* ---------------------------------------------------------------------------
   3. Custom cursor
   ------------------------------------------------------------------------ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
}

body.has-cursor .cursor {
  display: block;
}

body.has-cursor,
body.has-cursor * {
  cursor: none !important;
}

.cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.95), 0 0 22px rgba(252, 182, 182, 0.55);
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  transition: width var(--fast), height var(--fast), background var(--fast),
    box-shadow var(--fast);
}

body.cursor-hot .cursor__dot {
  width: 13px;
  height: 13px;
  background: var(--brand-soft);
  box-shadow: 0 0 14px rgba(252, 182, 182, 0.95), 0 0 30px rgba(219, 16, 9, 0.6);
}

body.cursor-down .cursor__dot {
  width: 6px;
  height: 6px;
}

.spark {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 998;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: spark-out 680ms var(--ease) forwards;
}

@keyframes spark-out {
  0% {
    opacity: 0.95;
    transform: translate3d(-50%, -50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--sx, 0px)), calc(-50% + var(--sy, 0px)), 0) scale(0.2);
  }
}

/* ---------------------------------------------------------------------------
   4. Entry gate
   ------------------------------------------------------------------------ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(5, 5, 5, 0.62);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  transition: opacity 620ms var(--ease), backdrop-filter 620ms var(--ease),
    visibility 0s linear 620ms;
}

.gate.is-gone {
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
}

.gate__inner {
  text-align: center;
  animation: gate-breathe 4.4s ease-in-out infinite;
}

.gate__title {
  margin: 0;
  font-size: clamp(42px, 9vw, 78px);
  font-weight: 600;
  letter-spacing: -0.03em;
  background: linear-gradient(100deg, #fff 18%, var(--brand-soft) 56%, var(--brand) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(219, 16, 9, 0.25);
}

.gate__hint {
  margin: 14px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gate__hint .icon {
  font-size: 13px;
  color: var(--brand-soft);
}

@keyframes gate-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

/* ---------------------------------------------------------------------------
   5. Stage & profile card
   ------------------------------------------------------------------------ */
.stage {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
}

.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  max-width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.055) 0%,
      rgba(255, 255, 255, 0.015) 42%,
      rgba(255, 255, 255, 0.03) 100%
    ),
    var(--surface);
  backdrop-filter: blur(26px) saturate(1.25);
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
  box-shadow: var(--shadow-card), 0 0 70px -30px rgba(219, 16, 9, 0.5);
  overflow: hidden;
  transform: translateY(18px) scale(0.985);
  opacity: 0;
  transition: transform 260ms var(--ease), box-shadow 320ms var(--ease);
}

body.is-ready .card {
  animation: rise 760ms var(--ease) forwards;
}

.card:hover {
  box-shadow: var(--shadow-card), 0 0 90px -28px rgba(219, 16, 9, 0.62);
}

/* --cx / --cy are driven by the parallax code so the card can keep drifting
   after the entry animation has finished (animation fill overrides inline
   transforms, variables are re-evaluated every frame). */
@keyframes rise {
  to {
    opacity: 1;
    transform: translate3d(var(--cx, 0px), var(--cy, 0px), 0) scale(1);
  }
}

/* soft moving light across the card */
.card__sheen {
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    38% 30% at 50% 50%,
    rgba(252, 182, 182, 0.09),
    transparent 70%
  );
  pointer-events: none;
  animation: sheen 18s ease-in-out infinite alternate;
}

@keyframes sheen {
  0% {
    transform: translate3d(-12%, -8%, 0);
  }
  100% {
    transform: translate3d(14%, 10%, 0);
  }
}

/* banner ----------------------------------------------------------------- */
.card__banner {
  position: relative;
  flex: none;
  height: 168px;
  overflow: hidden;
  background: #100c0d;
}

.card__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.06) brightness(0.94);
  /* Fading the image itself (rather than painting a gradient over it) lets the
     card's own translucent surface show through, so there is no seam. */
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 54%,
    rgba(0, 0, 0, 0.4) 84%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 54%,
    rgba(0, 0, 0, 0.4) 84%,
    transparent 100%
  );
}

/* keeps the status pills readable over a bright frame of the gif */
.card__banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.52) 0%, rgba(8, 8, 8, 0) 58%);
  pointer-events: none;
}

.card.no-banner .card__banner {
  display: none;
}

/* top status row --------------------------------------------------------- */
.card__top {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* sitting over artwork, the pills need their own backdrop */
.card__top .pill {
  background: rgba(10, 9, 10, 0.5);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.card__top .pill:hover {
  background: rgba(16, 14, 15, 0.68);
}

.pill-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}

.pill:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: #e6e6e9;
}

.pill .icon {
  font-size: 13px;
  color: var(--brand-soft);
  opacity: 0.9;
}

.pill__time {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill__sep,
.pill__utc {
  opacity: 0.72;
  font-size: 11px;
}

.pill--views #stat-views {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill--online #stat-online {
  color: var(--text);
  font-weight: 600;
}

.pill__label {
  opacity: 0.85;
}

.stat-bump {
  animation: bump 420ms var(--ease);
}

@keyframes bump {
  40% {
    transform: translateY(-3px);
    color: var(--brand-soft);
  }
}

/* ---------------------------------------------------------------------------
   6. Avatar / identity / socials
   ------------------------------------------------------------------------ */
.card__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  /* slight pull-up so the identity block sits closer to the banner's fade */
  margin-top: -8px;
  padding: 0 22px 4px;
}

.card.no-banner .card__body {
  margin-top: 0;
  padding-top: 8px;
}

.avatar {
  position: relative;
  width: 115px;
  height: 115px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: transform 420ms var(--ease);
}

.avatar:hover {
  transform: translateY(-4px) scale(1.035);
}

.avatar__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--brand) 0deg,
    var(--brand-soft) 95deg,
    rgba(255, 255, 255, 0.85) 150deg,
    var(--brand-soft) 215deg,
    var(--brand) 300deg,
    var(--brand) 360deg
  );
  animation: spin 7s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2.5px));
}

.avatar__glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(219, 16, 9, 0.45), transparent 66%);
  filter: blur(14px);
  opacity: 0.6;
  animation: breathe 4.2s ease-in-out infinite;
  pointer-events: none;
}

.avatar__img {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(8, 8, 8, 0.9);
  background: #111;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.9);
}

.avatar__spark {
  position: absolute;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 0 10px rgba(252, 182, 182, 0.9);
  opacity: 0;
  animation: twinkle 3.4s ease-in-out infinite;
  pointer-events: none;
}

.avatar__spark--a {
  top: -10px;
  left: -2px;
  animation-delay: 0s;
}
.avatar__spark--b {
  top: 6px;
  right: -14px;
  animation-delay: 1.15s;
}
.avatar__spark--c {
  bottom: -4px;
  left: -14px;
  animation-delay: 2.1s;
}

@keyframes twinkle {
  0%,
  72%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
  36% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.07);
  }
}

.display-name {
  margin: 20px 0 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.028em;
  background: linear-gradient(96deg, #ffffff 22%, var(--brand-soft) 70%, var(--brand) 104%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 46px rgba(219, 16, 9, 0.22);
}

.handle {
  margin: 7px 0 0;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.bio {
  margin: 12px 0 0;
  max-width: 420px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.5;
  color: #d4d4d8;
}

/* socials ---------------------------------------------------------------- */
.socials {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  justify-content: center;
}

.social {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: #d9d9de;
  transition: transform 260ms var(--ease), border-color var(--fast), background var(--fast),
    color var(--fast), box-shadow 260ms var(--ease);
}

.social .icon {
  font-size: 20px;
  transition: transform 260ms var(--ease);
}

.social::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(219, 16, 9, 0.5), rgba(252, 182, 182, 0.28));
  opacity: 0;
  transition: opacity var(--fast);
  z-index: -1;
  filter: blur(9px);
}

/* At rest the icons stay monochrome so the red/pink identity leads; on hover
   each glyph picks up its own platform colour. */
.social[data-id='discord'] {
  --sc: #5865f2;
}
.social[data-id='steam'] {
  --sc: #8fc8f0;
}
.social[data-id='spotify'] {
  --sc: #1ed760;
}

.social:hover {
  transform: translateY(-5px);
  color: var(--sc, #fff);
  border-color: rgba(252, 182, 182, 0.42);
  background: linear-gradient(150deg, rgba(219, 16, 9, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow: var(--glow-brand);
}

.social:hover .icon {
  transform: scale(1.1);
}

.social:active {
  transform: translateY(-2px) scale(0.97);
}

.social:hover::after {
  opacity: 1;
}

/* recent visitors -------------------------------------------------------- */
.visitors {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.visitors__title {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
}

.visitors__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* overlapping stack, like a shared-with list */
.visitors__list {
  display: flex;
  align-items: center;
}

.visitors__list:empty {
  display: none;
}

.visitor {
  position: relative;
  width: 32px;
  height: 32px;
  margin-left: -9px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(16, 13, 14, 0.95);
  background: #151113;
  transition: transform 260ms var(--ease), border-color var(--fast), z-index 0s;
}

.visitor:first-child {
  margin-left: 0;
}

.visitor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visitor:hover {
  transform: translateY(-4px) scale(1.08);
  z-index: 2;
  border-color: rgba(252, 182, 182, 0.55);
}

/* the signed-in visitor looking at the page */
.visitor.is-me {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(252, 182, 182, 0.4), 0 0 14px -4px rgba(219, 16, 9, 0.9);
  z-index: 1;
}

.visitors__more {
  margin-left: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.visitors__action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 220ms var(--ease), color var(--fast), border-color var(--fast),
    background var(--fast), box-shadow var(--fast);
}

.visitors__action .icon {
  font-size: 15px;
}

.visitors__action:hover {
  transform: translateY(-3px);
  color: #fff;
  border-style: solid;
  border-color: rgba(252, 182, 182, 0.45);
  background: linear-gradient(150deg, rgba(219, 16, 9, 0.26), rgba(255, 255, 255, 0.05));
  box-shadow: var(--glow-brand);
}

.visitors__action--leave:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
   7. Discord widget
   ------------------------------------------------------------------------ */
.discord-list {
  flex: none;
  margin: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discord-list:empty {
  display: none;
}

.discord {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 260ms var(--ease), border-color var(--fast), background var(--fast),
    box-shadow 260ms var(--ease);
}

.discord:hover {
  transform: translateY(-2px);
  border-color: rgba(252, 182, 182, 0.3);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9), 0 0 32px -14px rgba(219, 16, 9, 0.45);
}

.discord__icon {
  position: relative;
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #15131a;
}

.discord__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-area: 1 / 1;
  /* Some server icons are a wide wordmark floating in a square with a lot of
     empty padding. iconZoom in profile.json crops that padding away. */
  transform: scale(var(--icon-zoom, 1));
}

/* shown when a server has no icon file of its own */
.discord__glyph {
  grid-area: 1 / 1;
  width: 21px;
  height: 21px;
  fill: none;
  color: #b8b8c2;
}

.discord__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.discord__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discord__counts {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.discord__stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.discord__stat b {
  color: #e9e9ee;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.discord__bullet {
  opacity: 0.4;
}

.discord__fallback {
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.85;
}

.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #b00d07 58%, var(--brand-deep) 100%);
  box-shadow: 0 8px 22px -12px rgba(219, 16, 9, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform var(--fast), filter var(--fast), box-shadow var(--fast);
}

.btn-brand .icon {
  font-size: 15px;
}

.discord:hover .btn-brand {
  filter: brightness(1.1);
  box-shadow: 0 10px 28px -10px rgba(219, 16, 9, 1), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.discord:active .btn-brand {
  transform: scale(0.97);
}

/* ---------------------------------------------------------------------------
   8. Music player
   ------------------------------------------------------------------------ */
.player {
  position: relative;
  width: var(--card-w);
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px 11px 11px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    var(--surface);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transform: translateY(16px);
}

body.is-ready .player {
  animation: rise 760ms var(--ease) 140ms forwards;
}

.player__cover {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #141115;
}

.player__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.player__cover-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.player.is-playing .player__cover img {
  animation: cover-pulse 3.6s ease-in-out infinite;
}

.player.is-playing .player__cover::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 26px -4px rgba(219, 16, 9, 0.8);
  pointer-events: none;
  animation: breathe 3.6s ease-in-out infinite;
}

@keyframes cover-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

.player__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.player__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.player__artist {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.player__bar {
  display: flex;
  align-items: center;
  gap: 9px;
}

.player__time {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 30px;
}

.player__time:last-of-type {
  text-align: right;
}

/* seek ------------------------------------------------------------------- */
.seek {
  position: relative;
  flex: 1 1 auto;
  height: 16px;
  display: flex;
  align-items: center;
  touch-action: none;
}

.seek__track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
  transition: height var(--fast);
}

.seek:hover .seek__track,
.seek.is-dragging .seek__track {
  height: 5px;
}

.seek__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-soft) 100%);
  box-shadow: 0 0 12px -2px rgba(219, 16, 9, 0.9);
}

.seek__knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(252, 182, 182, 0.9);
  transform: translateY(-50%) scale(0);
  transition: transform 180ms var(--ease);
}

.seek:hover .seek__knob,
.seek.is-dragging .seek__knob,
.seek:focus-visible .seek__knob {
  transform: translateY(-50%) scale(1);
}

/* controls --------------------------------------------------------------- */
.player__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.pbtn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #cfcfd6;
  border: 1px solid transparent;
  transition: color var(--fast), background var(--fast), transform var(--fast),
    border-color var(--fast);
}

.pbtn .icon {
  font-size: 15px;
}

.pbtn:hover {
  color: #fff;
  background: var(--surface-3);
  border-color: var(--line);
}

.pbtn:active {
  transform: scale(0.92);
}

.pbtn--play {
  width: 40px;
  height: 40px;
  color: #fff;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px -12px rgba(219, 16, 9, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.pbtn--play .icon {
  font-size: 16px;
}

.pbtn--play:hover {
  background: linear-gradient(140deg, #ef1a12, var(--brand-deep));
  filter: brightness(1.06);
}

.icon--pause,
.icon--muted,
.icon--check {
  display: none;
}

.player.is-playing .pbtn--play .icon--play {
  display: none;
}

.player.is-playing .pbtn--play .icon--pause {
  display: block;
}

.is-muted .icon--vol {
  display: none;
}

.is-muted .icon--muted {
  display: block;
}

/* volume ----------------------------------------------------------------- */
.volume {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
}

.volume__slider {
  width: 0;
  height: 16px;
  display: flex;
  align-items: center;
  opacity: 0;
  overflow: hidden;
  touch-action: none;
  transition: width 260ms var(--ease), opacity 200ms var(--ease), margin 260ms var(--ease);
}

.volume:hover .volume__slider,
.volume.is-open .volume__slider,
.volume__slider:focus-visible {
  width: 62px;
  opacity: 1;
  margin-right: 4px;
}

.volume__track {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.volume__fill {
  height: 100%;
  width: 60%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-soft), #fff);
}

/* ---------------------------------------------------------------------------
   9. Floating docks
   ------------------------------------------------------------------------ */
.dock {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 12, 13, 0.6);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 18px 44px -24px rgba(0, 0, 0, 0.95);
  opacity: 0;
  transform: translateY(14px);
}

body.is-ready .dock {
  animation: rise 700ms var(--ease) 280ms forwards;
}

.dock--left {
  left: calc(20px + env(safe-area-inset-left, 0px));
}

.dock--right {
  right: calc(20px + env(safe-area-inset-right, 0px));
}

.dock__lead {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
}

.dock__lead .icon {
  font-size: 15px;
}

.dock__items {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color var(--fast), background var(--fast), border-color var(--fast),
    transform var(--fast);
}

.lang:hover {
  color: #fff;
  background: var(--surface-3);
  transform: translateY(-1px);
}

.lang.is-active {
  color: #fff;
  background: linear-gradient(140deg, rgba(219, 16, 9, 0.85), rgba(141, 10, 5, 0.85));
  border-color: rgba(252, 182, 182, 0.35);
  box-shadow: 0 6px 18px -10px rgba(219, 16, 9, 1);
}

.qbtn {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  color: var(--muted);
  transition: color var(--fast), background var(--fast), border-color var(--fast),
    transform 220ms var(--ease);
}

.qbtn .icon {
  font-size: 16px;
  grid-area: 1 / 1;
}

.qbtn:hover {
  color: #fff;
  background: var(--surface-3);
  border-color: var(--line);
  transform: translateY(-2px);
}

.qbtn:active {
  transform: scale(0.93);
}

.qbtn.is-on {
  color: var(--brand-soft);
  border-color: rgba(252, 182, 182, 0.35);
  background: rgba(219, 16, 9, 0.16);
}

.qbtn.is-copied .icon--share {
  display: none;
}

.qbtn.is-copied .icon--check {
  display: block;
  color: #3ad17c;
}

/* ---------------------------------------------------------------------------
   10. Tooltips & toasts
   ------------------------------------------------------------------------ */
.tooltip {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(18, 16, 17, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 500;
  color: #ededf0;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px) scale(0.96);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
  box-shadow: 0 10px 28px -16px rgba(0, 0, 0, 1);
}

.tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, -10px) scale(1);
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(252, 182, 182, 0.26);
  background: rgba(20, 15, 16, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 1), 0 0 26px -16px rgba(219, 16, 9, 0.9);
  animation: toast-in 280ms var(--ease);
}

.toast .icon {
  font-size: 14px;
  color: var(--brand-soft);
}

.toast.is-leaving {
  animation: toast-out 240ms var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

/* ---------------------------------------------------------------------------
   11. Motion preferences
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .card,
  .player,
  .dock {
    opacity: 1 !important;
    transform: none !important;
  }

  .backdrop__particles {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   12. Responsive
   ------------------------------------------------------------------------ */
@media (max-height: 820px) and (min-width: 721px) {
  .stage {
    padding: 16px;
  }
  .card {
    height: min(var(--card-h), calc(100svh - 150px));
  }
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .stage {
    min-height: 100svh;
    justify-content: flex-start;
    padding: 18px 14px 100px;
    gap: 12px;
  }

  /* Auto margins centre the group without clipping the top when the content
     is taller than the viewport (which `justify-content: center` would). */
  .card {
    margin-top: auto;
  }

  .player {
    margin-bottom: auto;
  }

  .card {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border-radius: 22px;
  }

  .card__banner {
    height: 124px;
  }

  .card__top {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .card__body {
    margin-top: -34px;
    padding: 0 16px 20px;
  }

  .card.no-banner .card__body {
    padding-top: 56px;
  }

  .discord-list {
    margin: 0 14px 14px;
  }

  .display-name {
    font-size: 33px;
    margin-top: 18px;
  }

  .socials {
    margin-top: 22px;
  }

  .player {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
  }

  .player__main {
    flex: 1 1 140px;
  }

  .player__controls {
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .volume__slider {
    width: 70px;
    opacity: 1;
    margin-right: 4px;
  }

  .discord {
    flex-wrap: wrap;
  }

  .discord__meta {
    flex: 1 1 120px;
  }

  .dock {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .dock--left {
    left: calc(12px + env(safe-area-inset-left, 0px));
  }

  .dock--right {
    right: calc(12px + env(safe-area-inset-right, 0px));
  }

  .dock__lead {
    display: none;
  }

  .lang {
    padding: 0 7px;
    gap: 4px;
  }

  .toasts {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    width: max-content;
    max-width: calc(100vw - 32px);
  }
}

@media (max-width: 420px) {
  .lang span {
    display: none;
  }

  .lang {
    padding: 0 8px;
  }

  .player__title {
    max-width: 100%;
  }

  .player__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }

  .discord__counts {
    font-size: 11px;
  }
}

/* touch devices: no custom cursor, bigger targets ------------------------ */
@media (hover: none) {
  body.has-cursor .cursor {
    display: none;
  }

  body.has-cursor,
  body.has-cursor * {
    cursor: auto !important;
  }

  .volume__slider {
    width: 62px;
    opacity: 1;
  }
}
