@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap");

/* ==========================================================================
   ImZvyxq — "Aurora Glass" Design System
   Single stylesheet shared by every page.

   1.  Tokens
   2.  Themes
   3.  Reset & base
   4.  Ambient background
   5.  Glass primitives
   6.  Buttons / chips / badges
   7.  Navigation
   8.  Page shell & section heads
   9.  Profile hero
   10. Info tiles
   11. Discord activity
   12. Social grid
   13. Friends
   14. Donate
   15. Status
   16. Loading screen
   17. Settings panel
   18. Modals & toast
   19. Footer
   20. Keyframes
   21. Responsive
   22. RTL
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Theme driven — also written at runtime by settings.js on <html> */
  --bg-gradient-1: #0b0817;
  --bg-gradient-2: #241a4d;
  --bg-gradient-3: #101024;
  --card-bg: rgba(255, 255, 255, 0.05);
  --text-color: #f2f0ff;
  --text-secondary: #a9a6c4;
  --accent-color: #9d4edd;
  --accent-glow: rgba(157, 78, 221, 0.6);
  --particle-color: rgba(255, 255, 255, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.2);

  /* Secondary accent — per theme */
  --accent-2: #5cc8ff;
  --on-accent: #ffffff;

  /* Surfaces */
  --surface-1: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.11);
  --line-soft: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --lip: rgba(255, 255, 255, 0.34);

  /* Scrolled header: opaque enough to fully mask content scrolling underneath */
  --header-scrolled-bg: rgba(13, 9, 28, 0.9);

  /* Type */
  --font-main: "Plus Jakarta Sans", "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* Space */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 20px;
  --s-5: 28px;
  --s-6: 38px;
  --s-7: 52px;

  /* Elevation */
  --e-1: 0 4px 18px rgba(0, 0, 0, 0.28);
  --e-2: 0 14px 40px rgba(0, 0, 0, 0.34);
  --e-3: 0 28px 70px rgba(0, 0, 0, 0.44);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. THEMES
   -------------------------------------------------------------------------- */

/* Dark Purple (default) */
[data-theme="dark-purple"] {
  --bg-gradient-1: #0b0817;
  --bg-gradient-2: #241a4d;
  --bg-gradient-3: #101024;
  --accent-color: #9d4edd;
  --accent-2: #5cc8ff;
  --accent-glow: rgba(157, 78, 221, 0.6);
  --text-color: #f2f0ff;
  --text-secondary: #a9a6c4;
  --header-scrolled-bg: rgba(13, 9, 28, 0.9);
}

/* Dark Blue */
[data-theme="dark-blue"] {
  --bg-gradient-1: #060a1c;
  --bg-gradient-2: #12224f;
  --bg-gradient-3: #081226;
  --accent-color: #4a90e2;
  --accent-2: #22d3ee;
  --accent-glow: rgba(74, 144, 226, 0.6);
  --text-color: #eef4ff;
  --text-secondary: #9db0cc;
  --header-scrolled-bg: rgba(7, 12, 31, 0.9);
}

/* Dark Green */
[data-theme="dark-green"] {
  --bg-gradient-1: #04160e;
  --bg-gradient-2: #123a28;
  --bg-gradient-3: #071f16;
  --accent-color: #2ecc71;
  --accent-2: #38bdf8;
  --accent-glow: rgba(46, 204, 113, 0.55);
  --text-color: #ecfff5;
  --text-secondary: #9dc4ae;
  --header-scrolled-bg: rgba(5, 24, 16, 0.9);
}

/* Cyberpunk */
[data-theme="cyberpunk"] {
  --bg-gradient-1: #0a0a18;
  --bg-gradient-2: #1b0733;
  --bg-gradient-3: #120726;
  --accent-color: #00fff9;
  --accent-2: #ff2fb3;
  --accent-glow: rgba(0, 255, 249, 0.6);
  --text-color: #eafcff;
  --text-secondary: #8fb6c4;
  --on-accent: #05121a;
  --header-scrolled-bg: rgba(11, 8, 27, 0.92);
}

/* Catalina */
[data-theme="catalina"] {
  --bg-gradient-1: #0c0f1f;
  --bg-gradient-2: #14224a;
  --bg-gradient-3: #08152e;
  --accent-color: #e94560;
  --accent-2: #4facfe;
  --accent-glow: rgba(233, 69, 96, 0.6);
  --text-color: #f7eef1;
  --text-secondary: #b3a5ad;
  --header-scrolled-bg: rgba(11, 14, 33, 0.9);
}

/* Winter */
[data-theme="winter"] {
  --bg-gradient-1: #10243d;
  --bg-gradient-2: #294f7d;
  --bg-gradient-3: #163453;
  --accent-color: #87ceeb;
  --accent-2: #c8b6ff;
  --accent-glow: rgba(135, 206, 235, 0.6);
  --text-color: #f2faff;
  --text-secondary: #b3cfe0;
  --on-accent: #0b2135;
  --header-scrolled-bg: rgba(15, 35, 60, 0.9);
}

/* Light */
[data-theme="light"] {
  --bg-gradient-1: #eef0f8;
  --bg-gradient-2: #dfe3f5;
  --bg-gradient-3: #f6f7fc;
  --card-bg: rgba(255, 255, 255, 0.72);
  --text-color: #14122b;
  --text-secondary: #5a5674;
  --accent-color: #7b2cbf;
  --accent-2: #4f46e5;
  --accent-glow: rgba(123, 44, 191, 0.32);
  --particle-color: rgba(123, 44, 191, 0.4);
  --border-color: rgba(20, 18, 43, 0.1);
  --shadow-color: rgba(20, 18, 43, 0.12);

  --surface-1: rgba(255, 255, 255, 0.6);
  --surface-2: rgba(255, 255, 255, 0.78);
  --surface-3: rgba(255, 255, 255, 0.92);
  --line-soft: rgba(20, 18, 43, 0.07);
  --line: rgba(20, 18, 43, 0.12);
  --line-strong: rgba(20, 18, 43, 0.22);
  --lip: rgba(255, 255, 255, 0.9);

  --e-1: 0 4px 16px rgba(20, 18, 43, 0.08);
  --e-2: 0 14px 36px rgba(20, 18, 43, 0.1);
  --e-3: 0 28px 60px rgba(20, 18, 43, 0.14);
  --header-scrolled-bg: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .aurora__blob {
  opacity: 0.3;
}

[data-theme="light"] .grain {
  opacity: 0.03;
  mix-blend-mode: multiply;
}

[data-theme="light"] .settings-select option {
  background: #ffffff;
  color: #14122b;
}

/* --------------------------------------------------------------------------
   3. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  background: linear-gradient(150deg, var(--bg-gradient-1), var(--bg-gradient-3));
  min-height: 100vh;
  /* clip (not hidden) so <body> never becomes a scroll container, which would
     break the sticky site header */
  overflow-x: clip;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

button,
select,
input {
  font-family: inherit;
}

::selection {
  background: var(--accent-color);
  color: var(--on-accent);
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(128, 128, 128, 0.08);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-color), var(--accent-2));
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* --------------------------------------------------------------------------
   4. AMBIENT BACKGROUND
   -------------------------------------------------------------------------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--bg-gradient-2) 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-gradient-1) 0%, var(--bg-gradient-3) 100%);
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}

.aurora__blob--1 {
  width: 60vmax;
  height: 60vmax;
  top: -22vmax;
  left: -14vmax;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 66%);
  animation: auroraA 26s var(--ease-io) infinite alternate;
}

.aurora__blob--2 {
  width: 48vmax;
  height: 48vmax;
  top: 18vmax;
  right: -16vmax;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 66%);
  animation: auroraB 32s var(--ease-io) infinite alternate;
}

.aurora__blob--3 {
  width: 44vmax;
  height: 44vmax;
  bottom: -20vmax;
  left: 22vmax;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  opacity: 0.32;
  animation: auroraC 38s var(--ease-io) infinite alternate;
}

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

/* Legacy particle layer kept for backwards compatibility */
.particles-container,
#particles-container,
.floating-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--particle-color);
  animation: floatParticle linear infinite;
}

/* --------------------------------------------------------------------------
   5. GLASS PRIMITIVES
   -------------------------------------------------------------------------- */
.glass {
  position: relative;
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--e-2), inset 0 1px 0 var(--lip);
}

.glass--flat {
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
}

/* Decorative accent wash for hero-ish cards */
.sheen {
  background-image: radial-gradient(90% 150% at 8% 0%, var(--accent-glow) 0%, transparent 58%),
    linear-gradient(165deg, var(--surface-2), var(--surface-1));
}

/* --------------------------------------------------------------------------
   6. BUTTONS / CHIPS / BADGES
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-color);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn:active {
  transform: translateY(-1px) scale(0.985);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 12px 34px var(--accent-glow);
}

.btn--primary:hover {
  box-shadow: 0 18px 44px var(--accent-glow);
}

.btn--ghost {
  background: transparent;
}
.btn--ghost:hover {
  background: var(--surface-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-secondary);
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.chip i {
  color: var(--accent-color);
  font-size: 0.95em;
}

a.chip {
  text-decoration: none;
  cursor: pointer;
}

a.chip:hover {
  transform: translateY(-2px);
  background: var(--surface-3);
  border-color: var(--line-strong);
  color: var(--text-color);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.badge--ok {
  color: #3ba55c;
  border-color: rgba(59, 165, 92, 0.32);
  background: rgba(59, 165, 92, 0.1);
}

.badge--warn {
  color: #faa81a;
  border-color: rgba(250, 168, 26, 0.32);
  background: rgba(250, 168, 26, 0.1);
}

.badge--bad {
  color: #ed4245;
  border-color: rgba(237, 66, 69, 0.32);
  background: rgba(237, 66, 69, 0.1);
}

.badge--info {
  color: #4facfe;
  border-color: rgba(79, 172, 254, 0.32);
  background: rgba(79, 172, 254, 0.1);
}

/* --------------------------------------------------------------------------
   7. NAVIGATION
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 1000;
  width: min(1120px, calc(100% - 26px));
  margin: 14px auto 0;
  animation: dropInSelf 0.8s var(--ease) 0.1s backwards;
  transition: width 0.4s var(--ease), margin-top 0.4s var(--ease);
}

/* Soft full-width scrim: masks page content so it never clashes with the bar.
   The mask fades the blur out at the bottom, so there is no hard edge. */
.site-header::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: -30px;
  left: -50vw;
  right: -50vw;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--header-scrolled-bg) 40%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  transition: opacity 0.4s var(--ease);
}

.site-header.is-scrolled {
  top: 8px;
  width: min(1120px, calc(100% - 16px));
  margin-top: 8px;
}

.site-header.is-scrolled::before {
  opacity: 1;
}

.site-header.is-scrolled .top-buttons-container {
  background: var(--header-scrolled-bg);
  border-color: var(--line-strong);
  box-shadow: var(--e-3), inset 0 1px 0 var(--lip);
}

.top-buttons-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--e-2), inset 0 1px 0 var(--lip);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

/* The page links stay centred as a group so the account slot can sit apart. */
.nav-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.nav-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 9px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.32s var(--ease), background 0.32s var(--ease), border-color 0.32s var(--ease);
}

.nav-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transition: left 0.65s var(--ease);
  pointer-events: none;
}

.nav-btn:hover::before {
  left: 130%;
}

.nav-btn:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: var(--line);
}

.nav-btn__ico {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: #fff;
  background: var(--ico, linear-gradient(135deg, var(--accent-color), var(--accent-2)));
  box-shadow: 0 4px 14px var(--ico-glow, var(--accent-glow));
  transition: transform 0.32s var(--ease);
}

.nav-btn:hover .nav-btn__ico {
  transform: scale(1.1) rotate(-7deg);
}

.nav-btn--donate {
  --ico: linear-gradient(135deg, #ff8a65, #e74c3c);
  --ico-glow: rgba(231, 76, 60, 0.45);
}

.nav-btn--social {
  --ico: linear-gradient(135deg, #4facfe, #00c6fb);
  --ico-glow: rgba(79, 172, 254, 0.45);
}

.nav-btn--friends {
  --ico: linear-gradient(135deg, #b06bff, #7c3aed);
  --ico-glow: rgba(168, 85, 247, 0.45);
}

.nav-btn--status {
  --ico: linear-gradient(135deg, #3ba55c, #2ecc71);
  --ico-glow: rgba(59, 165, 92, 0.45);
}

/* Surprise follows the theme accent so it never clashes with the palette */
.nav-btn--surprise {
  --ico: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  --ico-glow: var(--accent-glow);
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text-color);
  box-shadow: 0 8px 24px -12px var(--accent-glow);
}

.nav-btn--surprise .nav-btn__ico {
  color: var(--on-accent);
}

.nav-btn--surprise:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px -10px var(--accent-glow);
}

/* Floating back button on sub pages */
.back-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  color: var(--text-color);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
  animation: dropInSelf 0.8s var(--ease) 0.15s backwards;
}

.back-btn:hover {
  transform: translateX(-5px);
  background: var(--surface-3);
}

.back-btn i {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   8. PAGE SHELL & SECTION HEADS
   -------------------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 96px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 18px var(--s-6);
}

/* Pages whose only top element is the floating back button need headroom */
.page--topped {
  padding-top: 92px;
}

.page--centered {
  justify-content: center;
}

.page-shell {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  animation: riseIn 0.85s var(--ease) 0.18s backwards;
}

.page-shell--narrow {
  max-width: 760px;
}

.page-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4);
  border-radius: var(--r-xl);
}

.page-head__avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
  background: conic-gradient(from 180deg, var(--accent-color), var(--accent-2), var(--accent-color));
  box-shadow: 0 16px 44px var(--accent-glow);
  animation: breathe 4s var(--ease-io) infinite;
}

.page-head h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  background: linear-gradient(120deg, var(--text-color) 5%, var(--accent-color) 55%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-head p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 46ch;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: var(--s-3);
}

.section-title i {
  color: var(--accent-color);
}

/* --------------------------------------------------------------------------
   9. PROFILE HERO
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-6) var(--s-5);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.hero__avatar-link {
  position: relative;
  display: block;
  border-radius: 50%;
  text-decoration: none;
  flex: 0 0 auto;
}

.hero__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--accent-color), var(--accent-2), var(--accent-color));
  box-shadow: 0 20px 55px var(--accent-glow);
  transition: transform 0.4s var(--ease);
}

.hero__ring::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.75;
  filter: blur(9px);
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(255, 255, 255, 0.85) 82%, transparent 100%);
  animation: ringSpin 5s linear infinite;
}

.hero__avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-gradient-1);
  border: 3px solid rgba(8, 6, 18, 0.7);
}

.hero__avatar-link:hover .hero__ring {
  transform: scale(1.045);
}

.profile-status-dot {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #747f8d;
  border: 4px solid var(--bg-gradient-1);
  box-shadow: 0 0 0 1px var(--line-soft);
  transition: background-color 0.3s var(--ease);
}

.profile-status-dot.online {
  background-color: #3ba55c;
  box-shadow: 0 0 14px rgba(59, 165, 92, 0.8);
}
.profile-status-dot.idle {
  background-color: #faa81a;
  box-shadow: 0 0 14px rgba(250, 168, 26, 0.8);
}
.profile-status-dot.dnd {
  background-color: #ed4245;
  box-shadow: 0 0 14px rgba(237, 66, 69, 0.8);
}

.hero__meta {
  min-width: 0;
}

.hero__name {
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 8px;
  background: linear-gradient(118deg, var(--text-color) 8%, var(--accent-color) 58%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: var(--s-3);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   10. INFO TILES
   -------------------------------------------------------------------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-3);
}

.info-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  text-align: left;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.info-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(80% 120% at 0% 0%, var(--accent-glow) 0%, transparent 70%);
  transition: opacity 0.35s var(--ease);
}

.info-item:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--e-2), 0 0 0 1px var(--line-soft);
}

.info-item:hover::after {
  opacity: 0.35;
}

.info-item__ico {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--accent-color);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.info-item__body {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.info-value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   11. DISCORD ACTIVITY
   -------------------------------------------------------------------------- */
.activity {
  padding: var(--s-4) var(--s-5) var(--s-5);
  border-radius: var(--r-lg);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.activity.has-activities {
  border-color: var(--line-strong);
  box-shadow: var(--e-2), 0 0 34px -6px var(--accent-glow), inset 0 1px 0 var(--lip);
}

.activity__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--s-3);
}

.activity__head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.activity-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-color);
  white-space: nowrap;
}

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  text-align: left;
  animation: riseIn 0.45s var(--ease) backwards;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.activity-item:hover {
  transform: translateX(5px);
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.activity-item > i {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--accent-color);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

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

.activity-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-activities-text {
  display: block;
  padding: 14px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
  border-radius: var(--r-md);
  border: 1px dashed var(--line);
}

.activity.no-activities {
  opacity: 0.78;
}

/* --------------------------------------------------------------------------
   12. SOCIAL LINKS
   -------------------------------------------------------------------------- */
.social-links-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 18px 13px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--surface-2), var(--surface-1));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  color: var(--text-color);
  text-decoration: none;
  overflow: hidden;
  animation: riseIn 0.6s var(--ease) backwards;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}

/* brand wash, revealed on hover */
.social-link::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.07;
  background: var(--brand, linear-gradient(135deg, var(--accent-color), var(--accent-2)));
  transition: opacity 0.35s var(--ease);
}

/* brand rail on the leading edge */
.social-link::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 0;
  border-radius: var(--r-pill);
  transform: translateY(-50%);
  background: var(--brand, linear-gradient(180deg, var(--accent-color), var(--accent-2)));
  transition: height 0.35s var(--ease);
}

.social-link:hover {
  transform: translateX(7px);
  border-color: var(--line-strong);
  box-shadow: var(--e-2), 0 0 28px -8px var(--brand-glow, var(--accent-glow)), inset 0 1px 0 var(--lip);
}

.social-link:hover::before {
  opacity: 0.17;
}

.social-link:hover::after {
  height: 58%;
}

.social-link__icon {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #fff;
  background: var(--brand, linear-gradient(135deg, var(--accent-color), var(--accent-2)));
  box-shadow: 0 9px 22px -7px var(--brand-glow, var(--accent-glow));
  transition: transform 0.35s var(--ease);
}

.social-link:hover .social-link__icon {
  transform: scale(1.07) rotate(-5deg);
}

.social-link__body {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.social-link__name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.social-link__handle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-link__action {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--line);
  opacity: 0.55;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.social-link:hover .social-link__action {
  opacity: 1;
  transform: scale(1.08);
  color: #fff;
  background: var(--brand, linear-gradient(135deg, var(--accent-color), var(--accent-2)));
  border-color: transparent;
}

.social-icon-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 7px;
}

.social-link.aparat .social-link__icon {
  background: #fff;
}

/* Brand colours */
.social-link.discord {
  --brand: linear-gradient(135deg, #5865f2, #4752c4);
  --brand-glow: rgba(88, 101, 242, 0.5);
}
.social-link.github {
  --brand: linear-gradient(135deg, #4b5563, #1f2429);
  --brand-glow: rgba(120, 130, 145, 0.45);
}
.social-link.youtube {
  --brand: linear-gradient(135deg, #ff2d2d, #c00);
  --brand-glow: rgba(255, 0, 0, 0.45);
}
.social-link.twitch {
  --brand: linear-gradient(135deg, #9146ff, #6d28d9);
  --brand-glow: rgba(145, 70, 255, 0.5);
}
.social-link.spotify {
  --brand: linear-gradient(135deg, #1db954, #12803b);
  --brand-glow: rgba(29, 185, 84, 0.5);
}
.social-link.aparat {
  --brand: linear-gradient(135deg, #e74c3c, #a5281b);
  --brand-glow: rgba(231, 76, 60, 0.5);
}
.social-link.twitter {
  --brand: linear-gradient(135deg, #1da1f2, #0b6ea8);
  --brand-glow: rgba(29, 161, 242, 0.5);
}
.social-link.telegram {
  --brand: linear-gradient(135deg, #2aabee, #0a6fa8);
  --brand-glow: rgba(42, 171, 238, 0.5);
}
.social-link.instagram {
  --brand: linear-gradient(135deg, #f9ce34, #ee2a7b 45%, #6228d7);
  --brand-glow: rgba(238, 42, 123, 0.5);
}

/* --------------------------------------------------------------------------
   13. FRIENDS
   -------------------------------------------------------------------------- */
.friends-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: var(--s-3);
}

.friend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--s-4) var(--s-3) var(--s-3);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  overflow: hidden;
  animation: riseIn 0.6s var(--ease) backwards;
  transition: transform 0.38s var(--ease), border-color 0.38s var(--ease), box-shadow 0.38s var(--ease);
}

.friend-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--accent-glow), transparent 62%);
  transition: opacity 0.38s var(--ease);
}

.friend-card:hover {
  transform: translateY(-7px);
  border-color: var(--line-strong);
  box-shadow: var(--e-3), 0 0 30px -6px var(--accent-glow), inset 0 1px 0 var(--lip);
}

.friend-card:hover::before {
  opacity: 0.22;
}

.friend-card__avatar {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 5px;
}

.friend-card .avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
  background: conic-gradient(from 140deg, var(--accent-color), var(--accent-2), var(--accent-color));
  box-shadow: 0 12px 30px -8px var(--accent-glow);
  transition: transform 0.38s var(--ease);
}

.friend-card:hover .avatar {
  transform: scale(1.06);
}

/* presence dot overlaid on the avatar */
.friend-card .status {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid var(--bg-gradient-1);
  background-color: #747f8d;
  transition: background-color 0.3s var(--ease);
}

.friend-card .status.online {
  background-color: #3ba55c;
  box-shadow: 0 0 12px rgba(59, 165, 92, 0.85);
}
.friend-card .status.idle {
  background-color: #faa81a;
  box-shadow: 0 0 12px rgba(250, 168, 26, 0.85);
}
.friend-card .status.dnd {
  background-color: #ed4245;
  box-shadow: 0 0 12px rgba(237, 66, 69, 0.85);
}
.friend-card .status.offline {
  background-color: #747f8d;
}

.friend-card .name {
  position: relative;
  max-width: 100%;
  font-size: 0.97rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-username {
  position: relative;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 0.71rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-secondary);
}

.friend-status i {
  font-size: 0.5rem;
}

.friend-status.online {
  color: #3ba55c;
  border-color: rgba(59, 165, 92, 0.32);
  background: rgba(59, 165, 92, 0.1);
}
.friend-status.idle {
  color: #faa81a;
  border-color: rgba(250, 168, 26, 0.32);
  background: rgba(250, 168, 26, 0.1);
}
.friend-status.dnd {
  color: #ed4245;
  border-color: rgba(237, 66, 69, 0.32);
  background: rgba(237, 66, 69, 0.1);
}
.friend-status.offline {
  color: var(--text-secondary);
}

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text-color);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.copy-btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.copy-btn i {
  color: var(--accent-color);
}

.no-friends {
  grid-column: 1 / -1;
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.98rem;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line);
}

/* --------------------------------------------------------------------------
   14. DONATE
   -------------------------------------------------------------------------- */
.donate-single {
  display: flex;
  justify-content: center;
}

.donate-card {
  --brand: linear-gradient(135deg, #ff9f43, #e74c3c);
  --brand-glow: rgba(231, 76, 60, 0.5);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  max-width: 520px;
  padding: var(--s-5);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface-2), var(--surface-1));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-2), inset 0 1px 0 var(--lip);
  color: var(--text-color);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.38s var(--ease), box-shadow 0.38s var(--ease), border-color 0.38s var(--ease);
}

.donate-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.16;
  background: var(--brand);
  transition: opacity 0.38s var(--ease);
}

.donate-card::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 45%;
  height: 180%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: rotate(14deg);
  transition: left 0.75s var(--ease);
}

.donate-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--e-3), 0 0 38px -6px var(--brand-glow), inset 0 1px 0 var(--lip);
}

.donate-card:hover::before {
  opacity: 0.26;
}

.donate-card:hover::after {
  left: 130%;
}

.donate-card__icon {
  position: relative;
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 14px 34px -8px var(--brand-glow);
  transition: transform 0.38s var(--ease);
}

.donate-card:hover .donate-card__icon {
  transform: scale(1.07) rotate(-6deg);
}

.donate-card__text {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.donate-card__title {
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.donate-card__desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.donate-card__cta {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.donate-card:hover .donate-card__cta {
  color: #fff;
  background: var(--brand);
  border-color: transparent;
  transform: translate(3px, -3px);
}

.thank-you {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  text-align: left;
}

.thank-you i {
  font-size: 1.7rem;
  color: var(--accent-color);
  animation: heartbeat 1.6s var(--ease-io) infinite;
}

.thank-you p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.98rem;
}

/* Redeem / support code block */
.support-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
}

.support-note i {
  margin-top: 3px;
  font-size: 1.15rem;
  color: var(--accent-color);
}

.support-note p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   15. STATUS
   -------------------------------------------------------------------------- */
.status-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 104px 18px var(--s-6);
}

.status-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 14px 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 6px 18px var(--accent-glow);
}

.status-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin: 24px 0 34px;
}

.status-header .header-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  padding: 3px;
  background: conic-gradient(from 180deg, var(--accent-color), var(--accent-2), var(--accent-color));
  box-shadow: 0 16px 42px var(--accent-glow);
  animation: breathe 4s var(--ease-io) infinite;
}

.status-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(120deg, var(--text-color) 5%, var(--accent-color) 60%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.overall-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  border-radius: var(--r-md);
  background: rgba(59, 165, 92, 0.09);
  border: 1px solid rgba(59, 165, 92, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: var(--s-5);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.overall-status-banner .status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 11px;
  background: #3ba55c;
  box-shadow: 0 0 16px rgba(59, 165, 92, 0.85);
  animation: dotPulse 2s var(--ease-io) infinite;
}

.overall-status-banner .status-label {
  font-size: 1rem;
  font-weight: 700;
  color: #3ba55c;
}

.overall-status-banner .status-time {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--s-3);
  width: 100%;
  max-width: 1080px;
  margin-bottom: var(--s-5);
}

.status-card {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  animation: riseIn 0.7s var(--ease) backwards;
  transition: transform 0.38s var(--ease), border-color 0.38s var(--ease), box-shadow 0.38s var(--ease);
}

.status-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--e-3), 0 0 30px -8px var(--accent-glow), inset 0 1px 0 var(--lip);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.card-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.card-icon.website {
  color: #4facfe;
}
.card-icon.pages {
  color: #b06bff;
}
.card-icon.api {
  color: #2ecc71;
}
.card-icon.worker {
  color: #f1c40f;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.card-url {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-badge.online {
  color: #3ba55c;
  background: rgba(59, 165, 92, 0.12);
  border-color: rgba(59, 165, 92, 0.3);
}
.status-badge.offline {
  color: #ed4245;
  background: rgba(237, 66, 69, 0.12);
  border-color: rgba(237, 66, 69, 0.3);
}
.status-badge.degraded {
  color: #faa81a;
  background: rgba(250, 168, 26, 0.12);
  border-color: rgba(250, 168, 26, 0.3);
}

.uptime-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.uptime-label span:first-child {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.uptime-label span:last-child {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
}

/* 90-day uptime strip: one bar per day */
.day-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
  /* the bars shrink to fit rather than pushing the card wider */
  overflow: hidden;
}

.day-bar {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #3ba55c, #2ecc71);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.day-bar.warn {
  height: 62%;
  background: #faa81a;
}

.day-bar.bad {
  height: 40%;
  background: #ed4245;
}

.day-bar:hover {
  opacity: 0.75;
  transform: scaleY(1.12);
}

.day-bars__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Summary tiles above the service grid */
.status-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: var(--s-3);
  width: 100%;
  max-width: 1080px;
  margin-bottom: var(--s-4);
}

.stat-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--e-1), inset 0 1px 0 var(--lip);
  overflow: hidden;
  animation: riseIn 0.6s var(--ease) backwards;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.stat-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(80% 120% at 0% 0%, var(--accent-glow) 0%, transparent 70%);
  transition: opacity 0.35s var(--ease);
}

.stat-tile:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
}

.stat-tile:hover::after {
  opacity: 0.28;
}

.stat-tile__icon {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: var(--accent-color);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.stat-tile__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.stat-tile__label {
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stat-tile__value {
  font-family: var(--font-mono);
  font-size: 1.06rem;
  font-weight: 700;
}

.status-card__foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  font-size: 0.71rem;
  color: var(--text-secondary);
}

.status-card__foot i {
  font-size: 0.7rem;
  color: var(--accent-color);
}

.response-time {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.response-time .label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.response-time .value {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 600;
}

.latency-bar {
  flex: 1;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.latency-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: #3ba55c;
  transition: width 0.6s var(--ease);
}

.latency-fill.medium {
  background: #faa81a;
}
.latency-fill.high {
  background: #ed4245;
}

.incidents-section {
  width: 100%;
  max-width: 1080px;
  margin-bottom: var(--s-5);
}

.incident-card {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.incident-card:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.incident-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: 8px;
}

.incident-title {
  font-size: 0.96rem;
  font-weight: 700;
}

.incident-status {
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.incident-status.resolved {
  color: #3ba55c;
  background: rgba(59, 165, 92, 0.12);
}
.incident-status.investigating {
  color: #faa81a;
  background: rgba(250, 168, 26, 0.12);
}
.incident-status.monitoring {
  color: #4facfe;
  background: rgba(79, 172, 254, 0.12);
}

.incident-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.incident-date a {
  color: var(--accent-color);
  text-decoration: none;
}

.incident-date a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   16. LOADING SCREEN
   -------------------------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--bg-gradient-1), var(--bg-gradient-3));
  transition: opacity 0.75s var(--ease), visibility 0.75s var(--ease);
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, var(--accent-glow) 0%, transparent 58%);
  opacity: 0.5;
  animation: glowPulse 3s var(--ease-io) infinite;
}

.loading-screen.hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.loading-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.loading-spinner {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 26px;
  border-radius: 50%;
  animation: ringSpin 1.6s linear infinite;
}

.loading-spinner::before,
.loading-spinner::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
}

.loading-spinner::before {
  inset: 0;
  border-top-color: var(--accent-color);
  border-right-color: var(--accent-2);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.loading-spinner::after {
  inset: 10px;
  border-bottom-color: var(--accent-2);
  border-left-color: var(--accent-color);
  opacity: 0.7;
  animation: ringSpin 1.05s linear infinite reverse;
}

.loading-text {
  margin-bottom: 18px;
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 7px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--text-color), var(--accent-color), var(--accent-2), var(--text-color));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientSlide 3s linear infinite, softBlink 2.2s var(--ease-io) infinite;
}

.loading-progress {
  width: 216px;
  height: 3px;
  margin: 0 auto;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 0 16px var(--accent-glow);
  transition: width 0.25s linear;
}

/* --------------------------------------------------------------------------
   17. SETTINGS PANEL
   -------------------------------------------------------------------------- */
.settings-panel {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 1100;
  animation: riseIn 0.85s var(--ease) 0.5s backwards;
}

.settings-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--surface-3), var(--surface-2));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--e-2), inset 0 1px 0 var(--lip);
  transition: transform 0.38s var(--ease), box-shadow 0.38s var(--ease);
}

.settings-toggle:hover {
  transform: rotate(90deg) scale(1.08);
  box-shadow: var(--e-2), 0 0 26px -4px var(--accent-glow), inset 0 1px 0 var(--lip);
}

.settings-dropdown {
  position: absolute;
  bottom: 66px;
  left: 0;
  min-width: 254px;
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: var(--e-3), inset 0 1px 0 var(--lip);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom left;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}

.settings-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.settings-dropdown h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: var(--s-3);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.settings-dropdown h3 i {
  color: var(--accent-color);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-reset-item {
  justify-content: center;
  padding-top: var(--s-3);
}

.settings-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 140px;
  padding: 9px 32px 9px 13px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background-color: var(--surface-2);
  color: var(--text-color);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a9a6c4' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.settings-select:hover {
  border-color: var(--accent-color);
}

.settings-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.settings-select option {
  background: #1b142e;
  color: #f2f0ff;
}

.settings-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.settings-reset-btn:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.12);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   18. MODALS & TOAST
   -------------------------------------------------------------------------- */
.copy-notification {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--e-3), inset 0 1px 0 var(--lip);
  color: var(--text-color);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateX(-50%) translateY(120px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

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

.copy-notification i {
  font-size: 1.05rem;
  color: var(--accent-color);
}

.copy-notification[data-type="theme"] i {
  color: var(--accent-color);
}
.copy-notification[data-type="language"] i {
  color: #4facfe;
}
.copy-notification[data-type="reset"] i {
  color: #ff8a80;
}

.contact-modal,
.contact-modal-404 {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 10, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s var(--ease);
}

.contact-modal.show,
.contact-modal-404.show {
  display: flex;
}

.contact-modal-content,
.contact-modal-content-404 {
  width: 100%;
  max-width: 430px;
  padding: var(--s-5) var(--s-4);
  border-radius: var(--r-xl);
  text-align: center;
  background: linear-gradient(165deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--line);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--e-3), inset 0 1px 0 var(--lip);
  animation: popIn 0.36s var(--ease);
}

.contact-modal-content h3,
.contact-modal-content-404 h3 {
  margin-bottom: var(--s-2);
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--accent-color);
}

.contact-modal-content p,
.contact-modal-content-404 p {
  margin-bottom: var(--s-4);
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

.contact-modal-content p + p {
  margin-top: calc(var(--s-4) * -1 + 6px);
}

.contact-modal-back-btn,
.contact-modal-back-btn-404 {
  padding: 11px 30px;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  color: var(--on-accent);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px var(--accent-glow);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.contact-modal-back-btn:hover,
.contact-modal-back-btn-404:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 40px var(--accent-glow);
}

/* --------------------------------------------------------------------------
   19. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  width: 100%;
  max-width: 1080px;
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-4) var(--s-3);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, var(--surface-1), transparent);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-secondary);
  font-size: 0.86rem;
  animation: fadeIn 0.9s var(--ease) 0.6s backwards;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-4);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.site-footer__logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 24px -12px var(--accent-glow);
}

.site-footer__id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.site-footer__name {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  color: var(--text-color);
}

.site-footer__tagline {
  font-size: 0.8rem;
  line-height: 1.4;
}

.site-footer__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.site-footer__nav a {
  padding: 5px 10px;
  border-radius: var(--r-pill);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.site-footer__nav a:hover {
  color: var(--text-color);
  background: var(--surface-2);
}

.site-footer__social {
  display: flex;
  align-items: center;
  gap: 7px;
}

.site-footer__social a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.site-footer__social a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-soft);
  font-size: 0.78rem;
}

.site-footer__top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.site-footer__top:hover {
  color: var(--accent-color);
}

.site-footer__top i {
  font-size: 0.78em;
}

/* --------------------------------------------------------------------------
   20. KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes auroraA {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(12vw, 8vh, 0) scale(1.18);
  }
}

@keyframes auroraB {
  0% {
    transform: translate3d(0, 0, 0) scale(1.1);
  }
  100% {
    transform: translate3d(-14vw, 10vh, 0) scale(1);
  }
}

@keyframes auroraC {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(10vw, -8vh, 0) scale(1.22);
  }
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Entrance animations.
   Fill mode must stay `backwards`, never `both`/`forwards`: a forwards fill keeps
   applying the final keyframe's `transform`, which silently overrides the hover
   transform of the same element (e.g. the card lift effects). */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Used by self-positioned elements (site header, floating back button) */
@keyframes dropInSelf {
  from {
    opacity: 0;
    transform: translateY(-22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.7;
  }
}

@keyframes gradientSlide {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 220% center;
  }
}

@keyframes softBlink {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 16px 44px var(--accent-glow);
  }
  50% {
    box-shadow: 0 16px 62px var(--accent-glow);
  }
}

@keyframes dotPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.16);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.85;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.05ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   21. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
  }
}

@media (max-width: 768px) {
  .site-header {
    top: 10px;
    width: calc(100% - 20px);
    margin-top: 10px;
  }

  .top-buttons-container {
    gap: 4px;
    padding: 7px;
    border-radius: var(--r-lg);
  }

  .nav-btn {
    padding: 8px 12px 8px 8px;
    font-size: 0.82rem;
  }

  .nav-btn__ico {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 0.82rem;
  }

  .page {
    padding: 24px 14px var(--s-5);
  }

  .page--topped {
    padding-top: 84px;
  }

  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: var(--s-4);
    padding: var(--s-5) var(--s-4);
  }

  .hero__meta {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero__chips {
    justify-content: center;
  }

  .info-item {
    text-align: left;
  }

  .status-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .status-nav {
    padding: 12px 16px;
  }

  .back-btn {
    top: 12px;
    right: 12px;
    padding: 10px 17px;
    font-size: 0.84rem;
  }

  .settings-panel {
    bottom: 16px;
    left: 16px;
  }
}

@media (max-width: 560px) {
  .top-buttons-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-btn {
    flex-direction: column;
    gap: 5px;
    padding: 8px 6px;
    font-size: 0.7rem;
    letter-spacing: 0;
    text-align: center;
  }

  .nav-btn__ico {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 0.85rem;
  }

  .nav-btn__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .nav-btn:hover {
    transform: none;
  }

  .social-links-grid {
    gap: 9px;
  }

  .social-link {
    padding: 12px 14px 12px 12px;
    gap: 13px;
  }

  .social-link__icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 1.15rem;
  }

  .social-link__action {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .donate-card {
    gap: var(--s-3);
    padding: var(--s-4);
  }

  .donate-card__icon {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 1.5rem;
  }

  .friends-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .site-footer {
    padding: var(--s-4) var(--s-3) var(--s-3);
  }

  .site-footer__inner {
    gap: var(--s-4);
  }

  .site-footer__bottom {
    justify-content: center;
    text-align: center;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .copy-notification {
    width: calc(100% - 32px);
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.86rem;
  }

  .settings-dropdown {
    min-width: 232px;
    padding: var(--s-3);
  }

  .settings-select {
    min-width: 118px;
    font-size: 0.83rem;
  }

  .overall-status-banner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px 20px;
  }
}

/* --------------------------------------------------------------------------
   22. RTL
   -------------------------------------------------------------------------- */
[dir="rtl"] body {
  font-family: "Vazirmatn", "Plus Jakarta Sans", "Tahoma", sans-serif;
}

[dir="rtl"] .back-btn {
  right: auto;
  left: 18px;
}

[dir="rtl"] .back-btn:hover {
  transform: translateX(5px);
}

[dir="rtl"] .back-btn i {
  transform: scaleX(-1);
}

[dir="rtl"] .nav-btn {
  padding: 8px 9px 8px 16px;
}

[dir="rtl"] .settings-panel {
  left: auto;
  right: 22px;
}

[dir="rtl"] .settings-dropdown {
  left: auto;
  right: 0;
  transform-origin: bottom right;
}

[dir="rtl"] .settings-select {
  background-position: left 11px center;
  padding: 9px 13px 9px 32px;
}

[dir="rtl"] .info-item {
  text-align: right;
}

[dir="rtl"] .activity-item {
  text-align: right;
}

[dir="rtl"] .activity-item:hover {
  transform: translateX(-5px);
}

[dir="rtl"] .activity__head::after {
  background: linear-gradient(270deg, var(--line), transparent);
}

[dir="rtl"] .social-link:hover {
  transform: translateX(-7px);
}

[dir="rtl"] .social-link::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .social-link__handle {
  direction: ltr;
  text-align: right;
}

[dir="rtl"] .donate-card__text {
  text-align: right;
}

[dir="rtl"] .donate-card:hover .donate-card__cta {
  transform: translate(-3px, -3px);
}

[dir="rtl"] .response-time,
[dir="rtl"] .card-header,
[dir="rtl"] .section-title,
[dir="rtl"] .activity__head,
[dir="rtl"] .uptime-label {
  direction: rtl;
}

[dir="rtl"] .status-header h1,
[dir="rtl"] .hero__name,
[dir="rtl"] .page-head h1 {
  letter-spacing: 0;
}

[dir="rtl"] .loading-text {
  letter-spacing: 3px;
}

@media (max-width: 560px) {
  [dir="rtl"] .nav-btn {
    padding: 8px 6px;
  }
}

/* Narrow screens: the 90-day strip must still fit without overflowing, so the
   bars are allowed to shrink below their ideal width and the gaps collapse. */
@media (max-width: 560px) {
  .day-bars {
    gap: 1px;
  }

  .day-bars__axis {
    font-size: 0.63rem;
  }
}

/* --------------------------------------------------------------------------
   23. AUTHENTICATION
   -------------------------------------------------------------------------- */

/* Account slot: a self-contained capsule at the right edge of the header, so
   it never reads as just another page link in the menu. */
.auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 var(--lip);
}

.auth-slot [hidden] {
  display: none !important;
}

.auth-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-color);
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease),
    transform 0.3s var(--ease);
}

.auth-cta:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.auth-cta--primary {
  border-color: transparent;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 10px 24px -10px var(--accent-glow);
}

.auth-cta--primary:hover {
  color: var(--on-accent);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 210px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.user-menu__trigger:hover,
.user-menu__trigger[aria-expanded="true"] {
  background: var(--surface-2);
  border-color: var(--line);
}

.user-menu__avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}

.user-menu__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The uploaded picture replaces the initial badge whenever one exists. */
.user-menu__avatar-img {
  padding: 0;
  background: none;
  object-fit: cover;
}

.user-menu__avatar-img[hidden] {
  display: none;
}

.user-menu__caret {
  font-size: 0.62rem;
  opacity: 0.6;
  transition: transform 0.3s var(--ease);
}

.user-menu__trigger[aria-expanded="true"] .user-menu__caret {
  transform: rotate(180deg);
}

.user-menu__menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 12px);
  z-index: 60;
  min-width: 228px;
  padding: 8px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--e-3);
  animation: dropInSelf 0.26s var(--ease);
}

.user-menu__head {
  display: grid;
  gap: 2px;
  padding: 9px 11px 11px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.user-menu__full {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

.user-menu__email {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.user-menu__item i {
  width: 16px;
  color: var(--text-secondary);
  transition: color 0.25s var(--ease);
}

.user-menu__item:hover {
  background: var(--surface-3);
}

.user-menu__item:hover i {
  color: var(--accent-color);
}

.user-menu__item--danger:hover {
  color: #ed4245;
}

.user-menu__item--danger:hover i {
  color: #ed4245;
}

.auth-wrap {
  display: grid;
  place-items: center;
  width: 100%;
}

.auth-card {
  width: min(460px, 100%);
  padding: var(--s-6);
  animation: dropInSelf 0.7s var(--ease) 0.05s backwards;
}

.auth-card__head {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: var(--s-5);
  text-align: center;
}

.auth-card__badge {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: var(--s-2);
  font-size: 1.35rem;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 12px 34px var(--accent-glow);
}

.auth-card__title {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.4px;
  color: var(--text-color);
}

.auth-card__subtitle {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.auth-form {
  display: grid;
  gap: var(--s-4);
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.auth-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-input--code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.45em;
  text-align: center;
}

.auth-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-1);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-color);
}

.auth-alert[hidden] {
  display: none;
}

.auth-alert i {
  margin-top: 2px;
  color: var(--accent-color);
}

.auth-alert[data-type="error"] {
  border-color: rgba(237, 66, 69, 0.34);
  background: rgba(237, 66, 69, 0.12);
}

.auth-alert[data-type="error"] i {
  color: #ed4245;
}

.auth-alert[data-type="success"] {
  border-color: rgba(59, 165, 92, 0.34);
  background: rgba(59, 165, 92, 0.12);
}

.auth-alert[data-type="success"] i {
  color: #3ba55c;
}

.auth-submit {
  width: 100%;
}

.auth-steps {
  display: grid;
  gap: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
}

.auth-steps[hidden] {
  display: none;
}

.auth-alt {
  margin: var(--s-4) 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-alt a {
  color: var(--accent-color);
  font-weight: 700;
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* The profile card uses the real photo (.auth-avatar-img); the old text-initial
   badge it replaced has been retired. */

.auth-account {
  display: grid;
}

.auth-account__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 15px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.auth-account__row:last-child {
  border-bottom: none;
}

.auth-account__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-account__label i {
  color: var(--accent-color);
}

.auth-account__value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-color);
  overflow-wrap: anywhere;
  text-align: end;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

.auth-actions .btn {
  flex: 1 1 160px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

[dir="rtl"] .auth-card__title {
  letter-spacing: 0;
}

@media (max-width: 560px) {
  .auth-card {
    padding: var(--s-5) var(--s-4);
  }

  .auth-account__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .auth-account__value {
    text-align: start;
  }
}

/* --------------------------------------------------------------------------
   24. ACCOUNT MENU, RESPONSIVE HEADER AND AVATARS
   -------------------------------------------------------------------------- */

/* On narrow screens the menu and the account slot each take a full row, so the
   login control can never be squeezed into an unreadable sliver. */
@media (max-width: 720px) {
  .top-buttons-container {
    justify-content: center;
  }

  .nav-cluster,
  .auth-slot {
    flex: 1 1 100%;
  }

  .nav-cluster {
    order: 1;
  }

  .auth-slot {
    order: 2;
    justify-content: center;
  }

  .user-menu__trigger {
    max-width: none;
  }
}

/* "Forgot your password?" sits at the end of the field it belongs to. */
.auth-field__aside {
  display: flex;
  justify-content: flex-end;
  font-size: 0.8rem;
  line-height: 1.4;
}

.auth-field__aside a {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
}

.auth-field__aside a:hover {
  text-decoration: underline;
}

/* Sub-section inside an account card (change email, etc.). */
.profile-section {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
}

.profile-section__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 var(--s-4);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-color);
}

.profile-section__title i {
  color: var(--accent-color);
}

.profile-section .auth-form {
  gap: var(--s-3);
}

.profile-section .auth-alert {
  margin: 0;
}

/* The current address, shown so the visitor knows what is being replaced. */
.profile-section__current {
  margin: 0 0 var(--s-4);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-section__current strong {
  color: var(--text-color);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* Single source of truth for avatar cropping: one square source image, always
   a circle, always filling its box without distortion. */
.hero__avatar,
.hero__ring img,
.page-head__avatar,
.status-header .header-avatar,
.site-footer__logo,
.user-menu__avatar,
.auth-avatar-img,
.profile-photo__preview,
.friend-card .avatar {
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Image variant of the account badge on /profile. */
.auth-avatar-img {
  display: block;
  width: 92px;
  height: 92px;
  padding: 3px;
  background: conic-gradient(from 180deg, var(--accent-color), var(--accent-2), var(--accent-color));
  box-shadow: 0 16px 42px var(--accent-glow);
  animation: breathe 4s var(--ease-io) infinite;
}

/* ==========================================================================
   Account page (/profile)
   --------------------------------------------------------------------------
   One hero, a section nav, then a grid of self-contained panels. Each panel
   holds one or more `.profile-block`s. Adding a future section (game scores,
   friends, chat) means dropping another `<section class="profile-panel">` into
   `.profile-grid` and a matching `.profile-nav__link` — no new layout rules.
   ========================================================================== */

.profile-layout {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

/* The loading card carries the same footprint as the real thing so the swap
   does not shift the page. */
.profile-loading {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------- hero */

.profile-hero {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-5);
}

.profile-hero__photo {
  position: relative;
  flex-shrink: 0;
}

.profile-hero__photo .auth-avatar-img {
  width: 112px;
  height: 112px;
}

/* Camera shortcut that jumps to the upload control in Settings. */
.profile-hero__photo-btn {
  position: absolute;
  inset-inline-end: -4px;
  inset-block-end: -4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  backdrop-filter: blur(10px);
  color: var(--text-color);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.profile-hero__photo-btn:hover {
  transform: scale(1.08);
  background: var(--accent-color);
  color: #fff;
}

.profile-hero__id {
  min-width: 0;
}

.profile-hero__name {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.6px;
  background: linear-gradient(120deg, var(--text-color), var(--accent-color) 65%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow-wrap: anywhere;
}

.profile-hero__handle {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: var(--s-1) 0 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--accent-color);
  overflow-wrap: anywhere;
}

.profile-hero__at {
  opacity: 0.65;
}

.profile-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.profile-hero__meta i {
  color: var(--accent-color);
}

/* ------------------------------------------------------------------- tabs */

/*
 * A sticky strip of pills. The moving highlight is decorative: profile.js sets
 * its width and translateX. It also has to be the offsetParent of that pill, so
 * this element must never gain a transform of its own.
 */
.profile-tabs {
  position: sticky;
  top: var(--s-2);
  z-index: 5;
  display: flex;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--header-scrolled-bg);
  backdrop-filter: blur(14px) saturate(140%);
  /* Four pills do not fit a phone, so the strip scrolls instead of wrapping. */
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tabs__pill {
  position: absolute;
  top: 6px;
  left: 0;
  width: 0;
  height: calc(100% - 12px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: 0 8px 22px -12px var(--accent-glow);
  /* Sliding the highlight is the whole "swap" gesture; the panes fade behind it. */
  transition: transform 0.36s var(--ease), width 0.36s var(--ease);
  pointer-events: none;
}

.profile-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.22s var(--ease);
}

.profile-tab i {
  font-size: 0.8rem;
  color: var(--accent-color);
  opacity: 0.7;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.profile-tab:hover {
  color: var(--text-color);
}

.profile-tab[aria-selected="true"] {
  color: var(--text-color);
}

.profile-tab[aria-selected="true"] i {
  opacity: 1;
  transform: scale(1.08);
}

.profile-tab:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.profile-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent-color);
  color: var(--on-accent);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

/* ----------------------------------------------------------------- panels */

/* The enter animation is retriggered by `hidden` being removed on each swap. */
.profile-tabpanel:not([hidden]) {
  animation: panelIn 0.34s var(--ease);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.profile-tabpanel:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 4px;
}

/* ----------------------------------------------------------------- panel */

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  /* Anchor links must not land under the sticky nav. */
  scroll-margin-top: 90px;
}

.profile-panel__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-color);
}

.profile-panel__title i {
  color: var(--accent-color);
}

.profile-panel__hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* A titled sub-area inside a panel; the rule keeps siblings visually apart. */
.profile-block {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
}

.profile-block__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
}

.profile-block__title i {
  color: var(--accent-color);
}

/* --------------------------------------------------------- read-only info */

.profile-info {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.profile-info__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.profile-info__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-info__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-info__label i {
  width: 15px;
  color: var(--accent-color);
}

.profile-info__value {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: end;
  color: var(--text-color);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ photo picker */

.profile-photo {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}

.profile-photo__preview {
  flex-shrink: 0;
  width: 84px;
  height: 84px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.profile-photo__side {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}

.profile-photo__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.profile-photo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

/* The real input stays in the DOM and focusable, so the label and the
   keyboard both work; only its box is collapsed. */
.profile-photo__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
}

.profile-photo__pick {
  cursor: pointer;
}

/* Keyboard users get the focus ring the hidden input cannot show itself. */
.profile-photo__input:focus-visible ~ .profile-photo__pick {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.profile-photo .auth-alert {
  margin: 0;
}

@media (min-width: 900px) {
  /*
   * Two columns inside a pane, for the panes that have several blocks. The
   * account pane keeps its read-only info full width and pairs the photo with
   * the identity form underneath.
   */
  .profile-panel--split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-4) var(--s-5);
    align-items: start;
  }

  .profile-panel--split .profile-panel__head,
  .profile-panel--split .profile-info {
    grid-column: 1 / -1;
  }

  [dir="rtl"] .profile-panel--split {
    /* Keeps the reading order of a two-column pane consistent in both scripts. */
    direction: rtl;
  }
}

@media (max-width: 560px) {
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: start;
  }

  .profile-panel {
    padding: var(--s-4);
  }

  .profile-tabs {
    top: 0;
    border-radius: var(--r-md);
  }

  .profile-tab {
    padding: 9px 13px;
    gap: 6px;
  }

  .profile-info__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .profile-info__value {
    text-align: start;
  }

  .profile-photo {
    flex-direction: column;
    align-items: flex-start;
  }
}

/*
 * The strip scrolls, so the labels are only dropped on a genuinely tiny screen
 * where they would never fit. Any earlier and a narrow window loses the tab
 * names while still having room to scroll to them.
 */
@media (max-width: 400px) {
  .profile-tab span:not(.profile-tab__badge) {
    display: none;
  }
}

/* Logical properties above already mirror the hero and the info rows, so only
   the two things that are genuinely physical need stating here. */
[dir="rtl"] .profile-hero__photo-btn {
  inset-inline-end: -4px;
}

/* ==========================================================================
   Auth modal (home page)
   --------------------------------------------------------------------------
   The same forms that live at /auth/signin and /auth/signup, shown in place so
   a visitor never leaves the page. The two panes cross-fade and the pill under
   the tab strip slides between them.
   ========================================================================== */

/* `.auth-modal` sets its own display, so the UA `[hidden]` rule needs help. */
.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: var(--s-4);
}

.auth-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 2, 12, 0.66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: authFade 0.3s var(--ease);
}

.auth-modal__dialog {
  position: relative;
  width: min(444px, 100%);
  max-height: calc(100vh - 2 * var(--s-4));
  overflow-y: auto;
  padding: var(--s-5);
  border-radius: var(--r-lg);
  box-shadow: var(--e-3);
  animation: authRise 0.38s var(--ease);
}

@keyframes authFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.auth-modal__close {
  position: absolute;
  inset-inline-end: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease), transform 0.28s var(--ease);
}

.auth-modal__close:hover {
  color: var(--text-color);
  background: var(--surface-3);
  transform: rotate(90deg);
}

.auth-modal__close:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.auth-modal__brand {
  margin-bottom: var(--s-5);
  text-align: center;
}

.auth-modal__mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--s-3);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  color: var(--on-accent);
  font-size: 1.05rem;
  box-shadow: 0 16px 34px -16px var(--accent-glow);
}

.auth-modal__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-color);
}

.auth-modal__sub {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------- sign in / up swap */

.auth-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  padding: 5px;
  margin-bottom: var(--s-4);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--surface-1);
}

.auth-switch__pill {
  position: absolute;
  top: 5px;
  left: 0;
  width: 0;
  height: calc(100% - 10px);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  box-shadow: 0 12px 26px -14px var(--accent-glow);
  transition: transform 0.34s var(--ease), width 0.34s var(--ease);
  pointer-events: none;
}

.auth-switch__tab {
  position: relative;
  z-index: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.24s var(--ease);
}

.auth-switch__tab[aria-selected="true"] {
  color: var(--on-accent);
}

.auth-switch__tab:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* `.auth-pane` is a section, so `[hidden]` is stated rather than assumed. */
.auth-pane[hidden] {
  display: none;
}

/* The wrapper for the two panes; positioned so a pane can anchor to it. */
.auth-panes {
  position: relative;
}

.auth-pane {
  animation: paneIn 0.32s var(--ease);
}

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

/* ------------------------------------------------------- decorated fields */

/*
 * An input with a leading icon, and optionally a trailing reveal button. The
 * `:has()` guard is what keeps the extra end padding off fields that have no
 * reveal button (name, email) — supported everywhere this site targets.
 */
.auth-field__wrap {
  position: relative;
  display: block;
}

.auth-field__wrap .auth-input {
  padding-inline-start: 42px;
}

.auth-field__wrap:has(.auth-field__reveal) .auth-input {
  padding-inline-end: 48px;
}

.auth-field__ico {
  position: absolute;
  inset-inline-start: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem;
  color: var(--text-secondary);
  pointer-events: none;
  transition: color 0.22s var(--ease);
}

.auth-field__wrap:focus-within .auth-field__ico {
  color: var(--accent-color);
}

.auth-field__reveal {
  position: absolute;
  inset-inline-end: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}

.auth-field__reveal:hover {
  color: var(--text-color);
  background: var(--surface-2);
}

.auth-field__reveal:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.auth-form__link {
  display: block;
  margin-top: calc(-1 * var(--s-2));
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  text-decoration: none;
  transition: color 0.22s var(--ease);
}

.auth-form__link:hover {
  color: var(--accent-color);
}

/* ==========================================================================
   Profile: empty states, people rows, chat and leaderboard
   ========================================================================== */

/* `.profile-tabpanel` is a `.profile-panel`, which sets `display: flex`, so the
   `[hidden]` attribute has to win explicitly for the tab swap to work. */
.profile-tabpanel[hidden] {
  display: none;
}

.profile-tab__badge[hidden] {
  display: none;
}

.profile-empty {
  margin: 0;
  padding: var(--s-3);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-align: center;
}

.profile-empty[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ people */

/* Deliberately not `.friend-card`: that class is the big centred tile on
   friends.html, and these rows are compact and horizontal. */
.people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
}

.people[hidden] {
  display: none;
}

/*
 * The friends pane uses these two containers instead of `.people`, because the
 * search results and the request list are separated by headings in the markup.
 * Same layout, different names.
 */
.friend-results,
.friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
}

.friend-results[hidden],
.friend-list[hidden] {
  display: none;
}

/* Requests the caller sent: still real rows, just visually quieter than an
   actionable one, so they do not compete with the incoming list above. */
.friend-list--muted .person {
  background: transparent;
  border-style: dashed;
}

.person {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  transition: border-color 0.24s var(--ease), background 0.24s var(--ease);
}

.person:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.person__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent-color), var(--accent-2));
  color: var(--on-accent);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

.person__info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.person__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__handle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.person__badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn--xs {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
}

/* A whole person row that acts as a button — the conversation picker. */
.person--pick {
  width: 100%;
  border-color: transparent;
  background: transparent;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.person--pick[aria-current="true"] {
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--accent-color);
}

[dir="rtl"] .person--pick[aria-current="true"] {
  box-shadow: inset -2px 0 0 var(--accent-color);
}

/* -------------------------------------------------------------------- chat */

.chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-3);
}

.chat__peers {
  min-width: 0;
}

.chat__peer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.chat__placeholder {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin: 0;
  padding: var(--s-4);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

.chat__placeholder[hidden] {
  display: none;
}

.chat__thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface-1);
  overflow: hidden;
}

.chat__thread[hidden] {
  display: none;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px var(--s-3);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-1);
}

.chat__back {
  display: none;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
}

.chat__back:hover {
  color: var(--text-color);
}

.chat__peer-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  object-fit: cover;
}

.chat__peer-name {
  min-width: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__state {
  margin-inline-start: auto;
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chat__state[hidden] {
  display: none;
}

.chat__log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: clamp(230px, 42vh, 380px);
  padding: var(--s-3);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.chat__msg {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.chat__msg--mine {
  align-items: flex-end;
}

.chat__bubble {
  max-width: min(78%, 460px);
  padding: 9px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  /* Keeps a message's own blank lines instead of collapsing them. */
  white-space: pre-wrap;
}

.chat__msg--mine .chat__bubble {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  color: var(--on-accent);
}

.chat__time {
  margin-top: 3px;
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.chat__composer {
  display: flex;
  gap: 8px;
  padding: var(--s-2);
  border-top: 1px solid var(--line-soft);
}

.chat__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.chat__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.chat__input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat__send {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-2));
  color: var(--on-accent);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 12px 26px -14px var(--accent-glow);
  transition: transform 0.24s var(--ease), filter 0.24s var(--ease);
}

.chat__send:hover {
  transform: scale(1.06);
}

.chat__send:disabled {
  transform: none;
  filter: grayscale(0.6) opacity(0.6);
  cursor: not-allowed;
}

.chat__thread .auth-alert {
  margin: 0 var(--s-2) var(--s-2);
}

@media (min-width: 760px) {
  /* Both columns are visible side by side, so the back button is redundant. */
  .chat {
    grid-template-columns: 236px minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 759px) {
  /* One column: picking a peer swaps the list for the thread. */
  .chat__placeholder {
    display: none;
  }

  .chat--open .chat__peers {
    display: none;
  }

  .chat__back {
    display: grid;
  }
}

/* ------------------------------------------------------------- leaderboard */

.stats-picker {
  margin-top: var(--s-3);
}

.stats-table-wrap {
  margin-top: var(--s-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  text-align: start;
  white-space: nowrap;
}

.stats-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.stats-table tbody tr {
  border-top: 1px solid var(--line-soft);
}

.stats-table tbody tr:hover {
  background: var(--surface-1);
}

/* The caller's own row, wherever they placed. */
.stats-table tbody tr[data-me="true"] {
  background: var(--surface-2);
  box-shadow: inset 2px 0 0 var(--accent-color);
}

[dir="rtl"] .stats-table tbody tr[data-me="true"] {
  box-shadow: inset -2px 0 0 var(--accent-color);
}

.stats-table__rank {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.stats-table__score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-color);
}

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

.stats-table__who .person__avatar {
  width: 26px;
  height: 26px;
  font-size: 0.7rem;
}

.stats-mine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: var(--s-3) 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.stats-mine[hidden] {
  display: none;
}

.stats-mine i {
  color: var(--accent-color);
}

.stats-mine strong {
  font-family: var(--font-mono);
  color: var(--text-color);
}
