@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=Outfit:wght@300..700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --wine: oklch(0.22 0.09 18);
  --wine-deep: oklch(0.15 0.07 18);
  --bubble: oklch(0.86 0.07 15);
  --bubble-deep: oklch(0.78 0.11 18);
  --rose: oklch(0.92 0.04 15);
  --rose-hot: oklch(0.55 0.22 22);
  --milk: oklch(0.96 0.02 20);
  --font-serif: 'Fraunces', ui-serif, Georgia, serif;
  --font-sans: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--wine); overscroll-behavior-y: none; }
body.shell-menu-open { overflow: hidden; }
body { color: var(--rose); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Branded mobile pull-to-refresh. Native overscroll refresh is disabled
   above; js/pull-refresh.js drives these progress and reload states. */
.vibe-pull-refresh {
  --pull-y: 0;
  --pull-progress: 0;
  position: fixed;
  top: calc(0.25rem + env(safe-area-inset-top));
  left: 50%;
  z-index: 5000;
  width: 10.5rem;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  pointer-events: none;
  opacity: calc(0.15 + var(--pull-progress) * 0.85);
  transform: translate(-50%, calc(-6rem + var(--pull-y) * 1px)) scale(calc(0.72 + var(--pull-progress) * 0.28));
  filter: blur(calc((1 - var(--pull-progress)) * 2px));
  transition: opacity 0.12s linear;
}
.vibe-pull-refresh.is-returning,
.vibe-pull-refresh.is-complete { transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease; }
.vibe-pull-refresh.is-complete { opacity: 0; transform: translate(-50%, -6rem) scale(0.7); }
.vpr-flight { position: relative; width: 4.3rem; height: 2.75rem; display: grid; place-items: center; }
.vpr-flight svg {
  position: relative;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  fill: #ff3f83;
  transform: rotate(calc(-18deg + var(--pull-progress) * 198deg));
  filter: drop-shadow(0 0 0.55rem rgb(255 63 131 / 0.95));
}
.vpr-flight i {
  position: absolute;
  left: 0.1rem;
  top: 50%;
  width: calc(0.8rem + var(--pull-progress) * 1.2rem);
  height: 0.12rem;
  border-radius: 999px;
  opacity: var(--pull-progress);
  transform-origin: right center;
  background: linear-gradient(90deg, transparent, #ff6598);
}
.vpr-flight i:nth-child(1) { transform: translateY(-0.48rem) rotate(8deg); }
.vpr-flight i:nth-child(2) { transform: translateY(0) rotate(0); }
.vpr-flight i:nth-child(3) { transform: translateY(0.48rem) rotate(-8deg); }
.vpr-copy {
  color: rgb(255 225 233 / 0.74);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.8);
}
.vibe-pull-refresh.is-armed .vpr-flight svg { fill: #beff50; filter: drop-shadow(0 0 0.7rem rgb(190 255 80 / 0.95)); animation: vpr-glance 0.34s ease-in-out infinite alternate; }
.vibe-pull-refresh.is-refreshing { opacity: 1; filter: none; transform: translate(-50%, calc(-6rem + var(--pull-y) * 1px)) scale(1); }
.vibe-pull-refresh.is-refreshing .vpr-flight svg { animation: vpr-dance 0.72s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.vibe-pull-refresh.is-refreshing .vpr-flight i { opacity: 1; animation: vpr-trail 0.72s ease-in-out infinite; }
.vibe-pull-refresh.is-launching .vpr-flight { animation: vpr-launch 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes vpr-glance { to { transform: rotate(25deg) scale(1.22); } }
@keyframes vpr-dance {
  0% { transform: translate(-0.55rem, 0.25rem) rotate(-35deg) scale(0.88); }
  35% { transform: translate(0.35rem, -0.35rem) rotate(35deg) scale(1.15); }
  70% { transform: translate(0.7rem, 0.2rem) rotate(155deg) scale(0.95); }
  100% { transform: translate(-0.55rem, 0.25rem) rotate(325deg) scale(0.88); }
}
@keyframes vpr-trail { 50% { width: 2.8rem; opacity: 0.25; } }
@keyframes vpr-launch { 55% { transform: translateX(-1rem) scale(0.8); } 100% { transform: translateX(2.4rem) scale(1.08); } }
@media (min-width: 1024px) { .vibe-pull-refresh { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .vibe-pull-refresh,
  .vibe-pull-refresh * { animation: none !important; transition-duration: 0.01ms !important; }
}

.sparkle-svg { display: inline-block; }
.sparkle-svg svg { display: block; fill: currentColor; }
.gold-tick,
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.14em;
  filter: drop-shadow(0 1px 3px oklch(0.35 0.14 70 / 0.55));
}
.gold-tick svg,
.verified-badge svg {
  display: block;
  width: 100%;
  height: 100%;
}
@keyframes twinkle { 0%,100% { opacity: 0.4; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
.twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes drift { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(3deg); } }

.shell { min-height: 100vh; position: relative; selection-background: var(--bubble); }
/* Same ambient background everywhere (this is the Create page's look,
   applied here since .shell-blobs is already a fixed, full-viewport div
   present on every shell page — no per-page override needed). */
.shell-blobs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 58% 8%, rgb(127 14 50 / 0.28), transparent 32rem),
    radial-gradient(circle at 74% 72%, rgb(105 11 43 / 0.18), transparent 30rem),
    linear-gradient(135deg, #210008 0%, #33000f 48%, #180006 100%);
}
.shell-blob { display: none; }

/* suspend banner */
.suspend-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: oklch(0.62 0.18 65 / 0.15);
  border-bottom: 1px solid oklch(0.65 0.18 65 / 0.3);
  backdrop-filter: blur(8px);
}
.suspend-banner svg {
  width: 1rem; height: 1rem; flex-shrink: 0;
  fill: none; stroke: oklch(0.75 0.18 65); stroke-width: 1.75; stroke-linecap: round;
}
.suspend-banner-text {
  flex: 1; font-size: 0.8125rem; color: oklch(0.88 0.12 65);
  line-height: 1.45;
}
.suspend-banner-text strong { color: oklch(0.95 0.14 65); font-weight: 600; }
.suspend-banner-close {
  flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 0.25rem;
  color: oklch(0.75 0.18 65 / 0.7); border-radius: 0.25rem;
  transition: color 0.15s;
}
.suspend-banner-close:hover { color: oklch(0.88 0.12 65); }
.suspend-banner-close svg {
  width: 0.875rem; height: 0.875rem;
  stroke: currentColor; stroke-width: 2;
}

/* topbar */
.shell-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: oklch(0.22 0.09 18 / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid oklch(0.92 0.04 15 / 0.1);
}
.icon-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  background: oklch(0.92 0.04 15 / 0.1);
  display: grid; place-items: center;
  color: var(--rose); border: none; cursor: pointer;
}
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; }
.shell-topbar h1 { font-size: 1.25rem; display: flex; align-items: center; gap: 0.25rem; margin-right: auto; }
.shell-mobile-title {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.shell-topbar .sparkle-svg { width: 0.75rem; height: 0.75rem; color: var(--rose-hot); }
.shell-topbar-logo-img { height: 1.875rem; width: auto; display: block; }
@media (min-width: 1024px) { .shell-topbar, .shell-drawer { display: none; } }

/* Shared top-right bar (notifications + profile pill) — every shell-based
   page gets this instead of a sidebar nav-link/profile-card, matching
   home.html's own top-right pattern. No background/border of its own, and
   fixed (not sticky/in-flow) so it floats over the page instead of
   reserving layout space — it must never push a page's own content down.
   Vibes.html already has its own dedicated notify/profile chrome, so it
   opts out (see .shell-page-vibes rule below) rather than showing both. */
.shell-topright-bar {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
@media (max-width: 1023px) {
  /* Sits below the mobile hamburger topbar (that one's sticky/in-flow,
     ~4rem tall) instead of overlapping its title. */
  .shell-topright-bar { top: 4.5rem; right: 1rem; }
}
.shell-page-vibes .shell-topright-bar { display: none; }
/* Yap's own layout has no room for it and doesn't need it — removed by request. */
.shell-page-yap .shell-topright-bar { display: none; }

/* Notify bell + profile pill — shared with home.html/vibes.html's own
   top-right chrome (same class names, single set of rules). */
.arena-notify-btn {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid oklch(0.92 0.04 15 / 0.18);
  background: oklch(0.92 0.04 15 / 0.06);
  color: var(--rose);
}
.arena-notify-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.arena-notify-btn:hover { background: oklch(0.92 0.04 15 / 0.1); }
.arena-notify-dot {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--rose-hot);
}

.arena-profile-wrap { position: relative; flex-shrink: 0; }
.arena-profile-btn {
  min-height: 2.6rem;
  gap: 0.6rem;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem;
  border: 1px solid oklch(0.92 0.04 15 / 0.18);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, oklch(0.96 0.02 20 / 0.13), oklch(0.96 0.02 20 / 0.04));
  color: var(--rose);
  cursor: pointer;
}
.arena-profile-btn svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.arena-profile-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--bubble);
  color: var(--wine-deep);
  font-weight: 900;
  position: relative;
}
.arena-profile-avatar .top-profile-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; opacity: 0; }
.arena-profile-avatar .top-profile-img.shown { opacity: 1; }
.arena-profile-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.arena-profile-copy strong { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; }
.arena-profile-copy small { color: oklch(0.92 0.04 15 / 0.55); font-size: 0.62rem; }
.arena-profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 11rem;
  background: oklch(0.25 0.1 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  border-radius: 0.9rem;
  padding: 0.4rem;
  box-shadow: 0 8px 32px oklch(0 0 0 / 0.45);
  z-index: 200;
}
.arena-dd-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.55rem;
  border: none;
  background: transparent;
  color: var(--rose);
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.arena-dd-item svg { width: 1rem; height: 1rem; flex-shrink: 0; stroke-width: 1.75; }
.arena-dd-item:hover { background: oklch(0.92 0.04 15 / 0.08); }
a.arena-dd-item.arena-dd-admin { display: none; color: #ffadc2; }
.arena-dd-logout {
  color: oklch(0.72 0.18 22);
  border-top: 1px solid oklch(0.92 0.04 15 / 0.08);
  margin-top: 0.15rem;
  padding-top: 0.6rem;
}
@media (max-width: 480px) {
  .arena-profile-copy { display: none; }
  .arena-profile-btn { width: 2.6rem; padding: 0; justify-content: center; }
}

/* drawer */
.shell-drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; opacity: 0; transition: opacity 0.2s ease, visibility 0.2s ease; }
.shell-drawer.open { visibility: visible; opacity: 1; }
.drawer-backdrop { position: absolute; inset: 0; background: oklch(0.15 0.07 18 / 0.7); backdrop-filter: blur(4px); border: none; cursor: pointer; padding: 0; }
.drawer-aside {
  position: absolute; inset-block: 0; left: 0; width: 78%; max-width: 20rem;
  background: var(--wine); display: flex; flex-direction: column; padding: 1.5rem; overflow-y: auto;
  transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.shell-drawer.open .drawer-aside { transform: translateX(0); }
.drawer-close { align-self: flex-end; width: 2.25rem; height: 2.25rem; margin-bottom: 0.5rem; }

/* layout */
.shell-layout { position: relative; z-index: 10; display: flex; max-width: 1600px; margin: 0 auto; padding: 0 1rem; gap: 1.5rem; }
@media (min-width: 640px) { .shell-layout { padding: 0 1.5rem; } }
@media (min-width: 1024px) {
  .shell-layout { gap: 2rem; }
  /* the row spans edge-to-edge so the sidebar sits flush against the
     true left edge; .shell-main gets its own max-width + auto margin
     below so the *content* still centers in the space left over next
     to the sidebar, instead of the whole row shifting left as one block */
  .shell-layout { max-width: none; margin: 0; padding-left: 0; }
}

.shell-sidebar { display: none; }
@media (min-width: 1024px) {
  .shell-sidebar {
    display: flex; flex-direction: column; align-items: center;
    width: 5rem; padding: 2rem 0;
    position: sticky; top: 0; height: 100vh; flex-shrink: 0;
    z-index: 30;
  }
}

/* Logo: full lockup image in drawer, icon-only image in narrow sidebar */
.shell-logo { margin-bottom: 1.75rem; padding: 0 0.5rem; display: flex; align-items: center; gap: 0.375rem; }
.shell-logo-full { height: 2.5rem; width: auto; display: block; }
.shell-logo-icon { display: none; height: 2.25rem; width: auto; }
.shell-sidebar .shell-logo { padding: 0; justify-content: center; margin-bottom: 1.5rem; }
.shell-sidebar .shell-logo-full { display: none; }
.shell-sidebar .shell-logo-icon { display: block; height: 2rem; width: auto; }

/* Nav */
.shell-nav { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; }

/* Base nav-link (drawer / mobile) */
.nav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 500;
  color: oklch(0.92 0.04 15 / 0.8);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: oklch(0.92 0.04 15 / 0.1); }
.nav-link.active { background: oklch(0.86 0.07 15 / 0.7); color: var(--wine-deep); }
.nav-link .left { display: flex; align-items: center; gap: 0.75rem; }
.nav-link svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.75; }
.nav-badge { background: var(--rose-hot); color: var(--wine-deep); font-size: 0.625rem; padding: 0.125rem 0.375rem; border-radius: 9999px; font-family: var(--font-mono); font-weight: 700; line-height: 1; }

/* Notification bell badge */
.notif-icon-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-notif-badge {
  position: absolute;
  top: -5px; right: -6px;
  background: var(--rose-hot);
  color: #fff;
  font-size: 0.5rem; font-weight: 700; font-family: var(--font-mono); line-height: 1;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px oklch(0.13 0.06 18);
  pointer-events: none;
  z-index: 5;
}

/* Narrow sidebar overrides */
@media (min-width: 1024px) {
  .shell-nav { align-items: center; gap: 0.25rem; }

  /* Icon-only pill */
  .shell-sidebar .nav-link {
    width: 3.25rem; height: 3.25rem;
    padding: 0;
    border-radius: 0.875rem;
    justify-content: center;
    position: relative;
    overflow: visible;
  }
  .shell-sidebar .nav-link .left { gap: 0; }
  .shell-sidebar .nav-label { display: none; }
  .shell-sidebar .nav-link svg { width: 1.5rem; height: 1.5rem; }
  /* Badge anchors to the full 3.25rem square on desktop */
  .shell-sidebar .notif-icon-wrap { position: static; }
  .shell-sidebar .nav-notif-badge { position: absolute; top: 6px; right: 6px; }

  /* Tooltip */
  .shell-sidebar .nav-link[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 0.875rem);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: oklch(0.27 0.1 18);
    border: 1px solid oklch(0.92 0.04 15 / 0.14);
    color: var(--rose);
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 200;
    box-shadow: 0 4px 16px oklch(0 0 0 / 0.3);
  }
  .shell-sidebar .nav-link[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* ── Unified sidebar look (was previously Yap-only) — same compact,
   red-accent sidebar on every page ──────────────────────────────────── */
@media (min-width: 1024px) {
  .shell-sidebar {
    width: 5.75rem;
    padding: 1.15rem 0.8rem 1rem;
    border-right: 1px solid rgb(255 83 125 / 0.2);
    background: linear-gradient(180deg, rgb(69 2 22 / 0.36), rgb(28 0 9 / 0.76));
  }
  .shell-sidebar .nav-link {
    width: 3rem;
    height: 3rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: rgb(255 236 240 / 0.86);
    background: transparent;
  }
  .shell-sidebar .nav-link svg {
    width: 1.3rem;
    height: 1.3rem;
  }
  .shell-sidebar .nav-link.active {
    color: #fff;
    border-color: rgb(255 45 104 / 0.5);
    background: linear-gradient(145deg, rgb(255 45 104 / 0.34), rgb(144 9 52 / 0.28));
    box-shadow: 0 14px 32px rgb(255 45 104 / 0.16);
  }
}

/* ── Profile card ───────────────────────────────────────────────── */
.shell-profile-card {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid oklch(0.92 0.04 15 / 0.08);
  width: 100%;
  position: relative;
}

/* Inner link (avatar + text) */
.spc-inner {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.5rem;
  border-radius: 0.75rem;
  color: inherit; text-decoration: none;
  transition: background 0.15s;
}
.spc-inner:hover { background: oklch(0.92 0.04 15 / 0.07); }

/* Avatar */
.spc-avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 9999px;
  background: oklch(0.27 0.1 18);
  border: 1.5px solid oklch(0.92 0.04 15 / 0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.spc-initial {
  font-family: var(--font-serif); font-size: 0.875rem; color: var(--rose);
}
.spc-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: none;
}
.spc-img.shown { display: block; }

/* Text */
.spc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.spc-name { font-size: 0.875rem; font-weight: 600; color: var(--rose); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spc-handle { font-size: 0.6875rem; color: oklch(0.92 0.04 15 / 0.5); font-family: var(--font-mono); }

/* Popup — hidden by default (drawer hides it; only sidebar shows it) */
.spc-popup { display: none; }

@media (min-width: 1024px) {
  /* Narrow sidebar: hide text, center avatar */
  .shell-sidebar .spc-inner { justify-content: center; padding: 0.5rem 0; }
  .shell-sidebar .spc-info { display: none; }

  /* Enable popup */
  .shell-sidebar .spc-popup {
    display: flex; flex-direction: column; gap: 0.75rem;
    position: absolute;
    bottom: 0;
    left: calc(100% + 0.875rem);
    width: 14rem;
    background: oklch(0.25 0.1 18);
    border: 1px solid oklch(0.92 0.04 15 / 0.14);
    border-radius: 1rem;
    padding: 1rem;
    opacity: 0; pointer-events: none;
    transform: translateX(-8px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 200;
    box-shadow: 0 8px 32px oklch(0 0 0 / 0.4);
  }
  /* Click-to-open (not hover) — JS adds .is-open to .shell-profile-card */
  .shell-sidebar .shell-profile-card.is-open .spc-popup {
    opacity: 1; pointer-events: auto; transform: translateX(0);
  }

  /* Popup avatar */
  .spc-popup-av {
    width: 3rem; height: 3rem; border-radius: 9999px;
    background: oklch(0.27 0.1 18);
    border: 1.5px solid oklch(0.92 0.04 15 / 0.15);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative; flex-shrink: 0;
  }
  .spc-popup-av .spc-initial { font-size: 1.125rem; }

  .spc-popup-meta { display: flex; flex-direction: column; gap: 0.125rem; }
  .spc-popup-meta .spc-name { font-size: 0.9375rem; }
  .spc-popup-meta .spc-handle { font-size: 0.75rem; }

  .spc-popup-btn {
    display: block; text-align: center;
    background: oklch(0.92 0.04 15 / 0.08);
    border: 1px solid oklch(0.92 0.04 15 / 0.12);
    color: var(--rose);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem; font-weight: 500;
    transition: background 0.15s;
  }
  .spc-popup-btn:hover { background: oklch(0.92 0.04 15 / 0.16); }
  .spc-logout-btn {
    width: 100%; text-align: center; cursor: pointer;
    background: transparent;
    border: 1px solid oklch(0.65 0.22 22 / 0.3);
    color: oklch(0.72 0.18 22);
    padding: 0.45rem 0.75rem; margin-top: 0.4rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem; font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
  }
  .spc-logout-btn:hover { background: oklch(0.65 0.22 22 / 0.12); border-color: oklch(0.65 0.22 22 / 0.5); }
}

.shell-main { flex: 1; min-width: 0; padding: 1.5rem 0; }
@media (min-width: 640px) { .shell-main { padding: 2.5rem 0; } }
@media (min-width: 1024px) { .shell-main { max-width: 1480px; margin: 0 auto; } }

/* page header */
.page-header { margin-bottom: 2rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (min-width: 640px) { .page-header { margin-bottom: 2.5rem; } }
.page-header .eyebrow { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.2em; color: oklch(0.92 0.04 15 / 0.5); margin-bottom: 0.5rem; }
.page-header h2 { font-size: 1.875rem; line-height: 1.05; }
@media (min-width: 640px) { .page-header h2 { font-size: 2.25rem; } }
@media (min-width: 1024px) { .page-header h2 { font-size: 3rem; } }
.page-header p { margin-top: 0.75rem; max-width: 60ch; color: oklch(0.92 0.04 15 / 0.7); font-size: 0.875rem; }
@media (min-width: 640px) { .page-header p { font-size: 1rem; } }

/* ── Custom confirm modal ──────────────────────────────────────────── */
.vibe-confirm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: oklch(0 0 0 / 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 1rem;
  animation: vc-bg-in 0.18s ease;
}
@keyframes vc-bg-in { from { opacity: 0; } to { opacity: 1; } }
.vibe-confirm-box {
  background: oklch(0.18 0.07 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem 1.25rem;
  max-width: 22rem; width: 100%;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.7);
  animation: vc-box-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes vc-box-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.vibe-confirm-msg {
  font-size: 0.9375rem; color: oklch(0.92 0.04 15 / 0.9);
  margin: 0 0 1.375rem; text-align: center; line-height: 1.55;
}
.vibe-confirm-actions {
  display: flex; gap: 0.625rem; justify-content: flex-end;
}
.vibe-confirm-btn {
  padding: 0.5rem 1.25rem; border-radius: 9999px; border: none;
  font-size: 0.875rem; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
}
.vibe-confirm-btn:active { transform: scale(0.96); }
.vibe-confirm-btn.cancel {
  background: oklch(0.92 0.04 15 / 0.1); color: oklch(0.92 0.04 15 / 0.75);
}
.vibe-confirm-btn.cancel:hover { background: oklch(0.92 0.04 15 / 0.16); }
.vibe-confirm-btn.ok {
  background: oklch(0.55 0.22 22); color: #fff;
}
.vibe-confirm-btn.ok:hover { opacity: 0.85; }

/* ── Report reason modal ─────────────────────────────────────────── */
.vibe-report-box {
  background: oklch(0.18 0.07 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem 1.25rem;
  max-width: 26rem; width: 100%;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.7);
  animation: vc-box-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.vibe-report-title {
  font-size: 0.9375rem; font-weight: 700;
  color: oklch(0.92 0.04 15 / 0.9);
  margin: 0 0 1rem; text-align: center;
}
.vibe-report-reasons {
  list-style: none; margin: 0 0 1.25rem; padding: 0;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.vibe-reason-btn {
  width: 100%; text-align: left; background: oklch(0.92 0.04 15 / 0.06);
  border: 1px solid oklch(0.92 0.04 15 / 0.1);
  border-radius: 0.625rem; padding: 0.5rem 0.75rem;
  color: oklch(0.92 0.04 15 / 0.75); font-size: 0.8125rem;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.vibe-reason-btn:hover { background: oklch(0.92 0.04 15 / 0.1); color: oklch(0.92 0.04 15 / 0.95); }
.vibe-reason-btn.selected {
  background: oklch(0.55 0.22 22 / 0.2); border-color: oklch(0.55 0.22 22);
  color: oklch(0.92 0.04 15); font-weight: 600;
}
.vibe-report-actions {
  display: flex; gap: 0.625rem; justify-content: flex-end;
}

/* ── "Keep vibing" success modal ─────────────────────────────────── */
.vibe-success-box {
  background: oklch(0.18 0.07 18);
  border: 1px solid oklch(0.92 0.04 15 / 0.14);
  border-radius: 1.5rem;
  padding: 2.5rem 1.75rem 1.75rem;
  max-width: 22rem; width: 100%;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.7);
  animation: vc-box-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  text-align: center;
}
.vibe-success-spark {
  font-size: 2rem; line-height: 1;
  animation: vs-spin 3s linear infinite;
  display: block; margin-bottom: 0.25rem;
}
@keyframes vs-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
.vibe-success-title {
  font-family: var(--font-serif); font-size: 1.625rem; font-weight: 700;
  color: var(--rose); margin: 0; letter-spacing: -0.02em;
}
.vibe-success-sub {
  font-size: 0.875rem; color: oklch(0.92 0.04 15 / 0.6);
  margin: 0.25rem 0 1rem; line-height: 1.6; font-family: var(--font-mono);
}
.vibe-success-btn {
  background: oklch(0.55 0.22 22); color: #fff;
  border: none; border-radius: 9999px; cursor: pointer;
  padding: 0.55rem 1.5rem; font-size: 0.875rem; font-weight: 700;
  font-family: var(--font-mono); letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
}
.vibe-success-btn:hover { opacity: 0.85; }
.vibe-success-btn:active { transform: scale(0.96); }

/* ── Notification callout bubble (Instagram-style speech bubble) ──── */
.notif-callout-bubble {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.625rem; height: 1.625rem;
  padding: 0 0.5rem;
  background: var(--rose-hot);
  color: #fff;
  font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono); line-height: 1;
  border-radius: 9999px;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 3px 12px oklch(0.55 0.22 22 / 0.5);
  animation: callout-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}
/* Left-pointing tail */
.notif-callout-bubble::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--rose-hot);
  border-left-width: 0;
}
@keyframes callout-in {
  0%   { opacity: 0; transform: scale(0.4); }
  65%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
.notif-callout-bubble.callout-out {
  animation: callout-out 0.26s ease-in forwards;
}
@keyframes callout-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.5); }
}

/* Bell ring animation class added by JS */
.notif-icon-wrap.bell-ring svg {
  animation: bell-ring 0.7s ease-in-out 0.5s both;
}
@keyframes bell-ring {
  0%,100% { transform: rotate(0deg); }
  15%     { transform: rotate(-22deg); }
  35%     { transform: rotate(22deg); }
  55%     { transform: rotate(-14deg); }
  75%     { transform: rotate(14deg); }
}

/* Desktop sidebar: icon-only mode — position bubble to the right of the square */
@media (min-width: 1024px) {
  .shell-sidebar .notif-callout-bubble {
    position: absolute;
    left: calc(100% + 0.875rem);
    top: 50%;
    animation: callout-desktop-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    pointer-events: none;
  }
  @keyframes callout-desktop-in {
    0%   { opacity: 0; transform: translateY(-50%) scale(0.4) translateX(-8px); }
    65%  { opacity: 1; transform: translateY(-50%) scale(1.15) translateX(2px); }
    100% { opacity: 1; transform: translateY(-50%) scale(1)   translateX(0); }
  }
  .shell-sidebar .notif-callout-bubble.callout-out {
    animation: callout-desktop-out 0.26s ease-in forwards;
  }
  @keyframes callout-desktop-out {
    from { opacity: 1; transform: translateY(-50%) scale(1); }
    to   { opacity: 0; transform: translateY(-50%) scale(0.5) translateX(4px); }
  }
}

/* ── Mobile topbar notification dot (on hamburger menu button) ────── */
.topbar-menu-btn { position: relative; }
.topbar-notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rose-hot);
  box-shadow: 0 0 0 2px oklch(0.13 0.06 18);
  pointer-events: none;
  animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

body.notification-drawer-open {
  overflow: hidden;
}

.notification-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.notification-drawer.open {
  pointer-events: auto;
}

.notification-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgb(0 0 0 / 0);
  cursor: default;
}

.notification-drawer-panel {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: min(560px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #070b0f;
  color: #fff;
  border-right: 1px solid rgb(255 255 255 / 0.14);
  box-shadow: 32px 0 90px rgb(0 0 0 / 0.36);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  outline: none;
}

.notification-drawer.open .notification-drawer-panel {
  transform: translateX(0);
}

.notification-drawer-head {
  min-height: 96px;
  padding: 26px 28px 18px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notification-drawer-head h2 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.notification-drawer-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.notification-drawer-close:hover {
  background: rgb(255 255 255 / 0.08);
}

.notification-drawer-close svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.notification-drawer-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 0 28px 18px 50px;
  scrollbar-width: none;
}

.notification-drawer-tabs::-webkit-scrollbar {
  display: none;
}

.notification-tab {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.notification-tab.is-active {
  border-color: #242a33;
  background: #242a33;
}

.notification-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 50px 38px;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / 0.2) transparent;
}

.notification-drawer-list::-webkit-scrollbar {
  width: 5px;
}

.notification-drawer-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgb(255 255 255 / 0.2);
}

.notification-group {
  padding: 18px 0 22px;
  border-top: 1px solid rgb(255 255 255 / 0.11);
}

.notification-group:first-child {
  border-top: 0;
}

.notification-group h3 {
  margin: 0 0 16px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
}

.notification-row {
  position: relative;
  min-height: 66px;
  margin: 0 -10px;
  padding: 9px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.notification-row:hover {
  background: rgb(255 255 255 / 0.055);
}

.notification-avatar {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #202733;
  color: #fff;
  font-weight: 900;
}

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

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

.notification-line {
  color: rgb(255 255 255 / 0.94);
  font-size: 16px;
  line-height: 1.24;
}

.notification-line strong {
  font-weight: 900;
}

.notification-preview {
  margin: 0;
  max-width: 100%;
  color: rgb(255 255 255 / 0.58);
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-time {
  color: rgb(255 255 255 / 0.56);
  font-size: 14px;
}

.notification-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #202733;
}

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

.notification-unread-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #159bff;
}

.notification-request {
  align-items: center;
  flex-wrap: wrap;
}

.notification-request .notification-copy {
  flex-basis: min(220px, 100%);
}

.notification-request-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.notification-request-actions button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.notification-request-actions button:first-child {
  background: #4f46e5;
  color: #fff;
}

.notification-request-actions button:last-child {
  background: #222832;
  color: #fff;
}

.notification-request-actions button:disabled {
  opacity: 0.48;
  cursor: default;
}

.notification-drawer-empty {
  padding: 32px 0;
  color: rgb(255 255 255 / 0.58);
  font-size: 15px;
}

@media (max-width: 620px) {
  .notification-drawer-panel {
    width: 100vw;
  }

  .notification-drawer-head {
    min-height: 82px;
    padding: 22px 18px 14px;
  }

  .notification-drawer-tabs {
    padding: 0 18px 16px;
  }

  .notification-drawer-list {
    padding: 0 18px 30px;
  }

  .notification-row {
    margin-inline: -6px;
    padding-inline: 6px;
  }

  .notification-request-actions {
    width: 100%;
    margin-left: 66px;
  }
}

/* --------------------------------------------------------------------------
   Responsive application shell
   One compact, safe-area aware frame for Home, Vibes, Yap, Community/Create.
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  html { overflow-x: hidden; }
  body { min-width: 0; overflow-x: clip; }

  .shell-topbar {
    min-height: calc(3.75rem + env(safe-area-inset-top));
    padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
    background: rgb(31 0 10 / 0.82);
    border-color: rgb(255 133 160 / 0.14);
    box-shadow: 0 0.75rem 2rem rgb(8 0 3 / 0.18);
    backdrop-filter: blur(22px) saturate(145%);
  }
  .shell-topbar { padding-right: 7.05rem; }
  .shell-topbar h1 { min-width: 0; }
  .shell-mobile-title {
    max-width: min(42vw, 12rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shell-topbar .icon-btn,
  .icon-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
  }

  .shell-topbar-logo-img { height: 2rem; }
  .shell-layout { width: 100%; padding: 0 1rem; gap: 0; }
  .shell-main { width: 100%; padding: 1.25rem 0 max(1.5rem, env(safe-area-inset-bottom)); }

  /* The top bar already owns the profile affordance on mobile. Keep only
     notifications from the desktop utility pill and align it with the bar. */
  .shell-topright-bar {
    top: calc(0.6rem + env(safe-area-inset-top));
    right: 4.45rem;
    z-index: 45;
  }
  .shell-topright-bar .arena-profile-wrap { display: none; }
  .shell-topright-bar .arena-notify-btn { width: 2.75rem; height: 2.75rem; }

  .drawer-aside {
    width: min(86vw, 22rem);
    max-width: none;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1.25rem + env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 15% 8%, rgb(255 48 103 / 0.16), transparent 16rem),
      rgb(35 0 12 / 0.97);
    border-right: 1px solid rgb(255 121 153 / 0.16);
    box-shadow: 2rem 0 5rem rgb(0 0 0 / 0.42);
  }

  .drawer-aside .nav-link { min-height: 3rem; border-radius: 0.85rem; }
  .drawer-close { width: 2.75rem; height: 2.75rem; }

  .notification-drawer-panel { padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 640px) {
  .shell-layout { padding-inline: 0.75rem; }
  .shell-main { padding-top: 1rem; }
  .arena-profile-dropdown { position: fixed; top: calc(3.65rem + env(safe-area-inset-top)); right: 0.75rem; }

  .notification-drawer-panel {
    top: auto;
    height: min(88dvh, 46rem);
    border-radius: 1.4rem 1.4rem 0 0;
    border-top: 1px solid rgb(255 128 157 / 0.2);
  }
  .notification-drawer-head { min-height: 4.5rem; padding: 1rem; }
  .notification-drawer-tabs,
  .notification-drawer-list { padding-inline: 1rem; }
}

/* Mobile navigation mirrors the new desktop rail instead of the legacy
   full sidebar. The page stays visible beside it, so navigation feels like
   part of the application rather than a second page laid over the first. */
@media (max-width: 1023px) {
  .shell-drawer .drawer-backdrop {
    background: rgb(7 0 3 / 0.54);
    backdrop-filter: blur(10px) saturate(90%);
  }

  .shell-drawer .drawer-aside {
    width: 6.25rem;
    min-width: 6.25rem;
    padding: calc(0.7rem + env(safe-area-inset-top)) 0.7rem max(0.8rem, env(safe-area-inset-bottom));
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    background:
      radial-gradient(circle at 50% 7%, rgb(255 45 104 / 0.18), transparent 10rem),
      linear-gradient(180deg, rgb(57 1 19 / 0.98), rgb(20 0 7 / 0.98));
    border-right: 1px solid rgb(255 83 125 / 0.22);
    box-shadow: 1.5rem 0 4rem rgb(0 0 0 / 0.45);
  }
  .shell-drawer .drawer-aside::-webkit-scrollbar { display: none; }

  .shell-drawer .drawer-close {
    order: 0;
    align-self: center;
    margin: 0 0 0.8rem;
    border: 1px solid rgb(255 112 145 / 0.17);
    border-radius: 0.8rem;
    background: rgb(255 236 240 / 0.065);
  }

  #shell-drawer-sidebar-mount {
    order: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
  }

  #shell-drawer-sidebar-mount .shell-logo {
    width: 3rem;
    height: 3rem;
    margin: 0 0 1rem;
    padding: 0;
    display: grid;
    place-items: center;
  }
  #shell-drawer-sidebar-mount .shell-logo-full { display: none; }
  #shell-drawer-sidebar-mount .shell-logo-icon { display: block; width: 2.15rem; height: 2.15rem; object-fit: contain; }

  #shell-drawer-sidebar-mount .shell-nav {
    width: 100%;
    align-items: center;
    gap: 0.45rem;
  }
  #shell-drawer-sidebar-mount .nav-link {
    position: relative;
    width: 3.25rem;
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    color: rgb(255 228 235 / 0.72);
    background: transparent;
  }
  #shell-drawer-sidebar-mount .nav-link .left { gap: 0; }
  #shell-drawer-sidebar-mount .nav-label { display: none; }
  #shell-drawer-sidebar-mount .nav-link svg { width: 1.35rem; height: 1.35rem; }
  #shell-drawer-sidebar-mount .nav-link.active {
    color: #fff;
    border-color: rgb(255 66 116 / 0.55);
    background: linear-gradient(145deg, rgb(255 45 104 / 0.38), rgb(128 7 45 / 0.32));
    box-shadow: 0 0.8rem 2rem rgb(255 45 104 / 0.18), inset 0 0 0 1px rgb(255 255 255 / 0.04);
  }
  #shell-drawer-sidebar-mount .nav-link:active { transform: scale(0.94); }
  #shell-drawer-sidebar-mount .notif-icon-wrap { position: static; }
  #shell-drawer-sidebar-mount .nav-notif-badge { top: 0.28rem; right: 0.25rem; }
}

/* Stable mobile menu: no sliding rail. Navigation opens as a purpose-built
   screen with readable, tactile destinations and zero transform animation. */
@media (max-width: 1023px) {
  .shell-drawer,
  .shell-drawer.open { transition: none; }
  .shell-drawer .drawer-backdrop { display: none; }
  .shell-drawer .drawer-aside,
  .shell-drawer.open .drawer-aside {
    inset: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    transform: none;
    transition: none;
    overflow-y: auto;
    background:
      radial-gradient(circle at 82% 9%, rgb(255 43 101 / 0.2), transparent 16rem),
      radial-gradient(circle at 10% 85%, rgb(143 11 53 / 0.18), transparent 20rem),
      linear-gradient(155deg, #27000d, #150006 72%);
  }
  .shell-drawer .drawer-close {
    position: absolute;
    top: calc(1rem + env(safe-area-inset-top));
    right: 1rem;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    margin: 0;
    border-radius: 1rem;
  }
  #shell-drawer-sidebar-mount {
    width: min(100%, 32rem);
    min-height: 100%;
    margin: 0 auto;
    padding: 0.2rem 0 1rem;
    justify-content: center;
  }
  #shell-drawer-sidebar-mount .shell-logo {
    width: max-content;
    height: auto;
    margin: 0 auto clamp(2rem, 7vh, 4rem);
  }
  #shell-drawer-sidebar-mount .shell-logo-full { display: block; width: auto; height: 2.8rem; }
  #shell-drawer-sidebar-mount .shell-logo-icon { display: none; }
  #shell-drawer-sidebar-mount .shell-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  #shell-drawer-sidebar-mount .nav-link {
    width: 100%;
    height: auto;
    min-height: 5.25rem;
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: flex-start;
    border-color: rgb(255 151 174 / 0.12);
    border-radius: 1.15rem;
    background: linear-gradient(145deg, rgb(255 255 255 / 0.065), rgb(255 255 255 / 0.025));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.035);
    transform: none;
    transition: border-color 0.12s ease, background 0.12s ease;
  }
  #shell-drawer-sidebar-mount .nav-link .left { width: 100%; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
  #shell-drawer-sidebar-mount .nav-label {
    display: block;
    color: rgb(255 239 243 / 0.88);
    font-size: 0.86rem;
    font-weight: 750;
  }
  #shell-drawer-sidebar-mount .nav-link svg { width: 1.4rem; height: 1.4rem; color: #ff6b96; }
  #shell-drawer-sidebar-mount .nav-link.active {
    border-color: rgb(255 79 126 / 0.6);
    background: linear-gradient(145deg, rgb(255 45 104 / 0.3), rgb(121 7 43 / 0.28));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 0.9rem 2.2rem rgb(255 23 82 / 0.13);
  }
  #shell-drawer-sidebar-mount .nav-link:active { transform: none; background: rgb(255 45 104 / 0.22); }
  #shell-drawer-sidebar-mount .notif-icon-wrap { position: relative; }
  #shell-drawer-sidebar-mount .nav-notif-badge { top: -0.35rem; right: -0.55rem; }
}

@media (max-width: 380px) {
  #shell-drawer-sidebar-mount .nav-link { min-height: 4.65rem; padding: 0.7rem 0.8rem; }
  #shell-drawer-sidebar-mount .shell-logo { margin-bottom: 1.5rem; }
}

/* Correction: page navigation remains a side sheet. Only Yap uses discrete
   list/chat screens. This motion is short and non-bouncy to avoid jitter. */
@media (max-width: 1023px) {
  .shell-drawer { transition: opacity 0.16s ease, visibility 0.16s ease; }
  .shell-drawer .drawer-backdrop {
    display: block;
    background: rgb(8 0 3 / 0.58);
    backdrop-filter: blur(8px);
  }
  .shell-drawer .drawer-aside,
  .shell-drawer.open .drawer-aside {
    inset: 0 auto 0 0;
    width: min(86vw, 22rem);
    min-width: 0;
    max-width: 22rem;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    align-items: stretch;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
    background:
      radial-gradient(circle at 18% 8%, rgb(255 45 104 / 0.17), transparent 14rem),
      linear-gradient(165deg, rgb(55 1 19 / 0.99), rgb(20 0 7 / 0.99));
  }
  .shell-drawer.open .drawer-aside { transform: translate3d(0, 0, 0); }
  .shell-drawer .drawer-close {
    top: calc(0.9rem + env(safe-area-inset-top));
    right: 0.9rem;
    width: 2.85rem;
    height: 2.85rem;
  }
  #shell-drawer-sidebar-mount {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
  }
  #shell-drawer-sidebar-mount .shell-logo {
    width: max-content;
    height: 3rem;
    margin: 0 0 2rem 0.25rem;
  }
  #shell-drawer-sidebar-mount .shell-logo-full { display: block; width: auto; height: 2.4rem; }
  #shell-drawer-sidebar-mount .shell-logo-icon { display: none; }
  #shell-drawer-sidebar-mount .shell-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }
  #shell-drawer-sidebar-mount .nav-link {
    width: 100%;
    min-height: 3.65rem;
    padding: 0.7rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 1rem;
    background: transparent;
    box-shadow: none;
  }
  #shell-drawer-sidebar-mount .nav-link .left {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
  }
  #shell-drawer-sidebar-mount .nav-label { font-size: 0.95rem; }
  #shell-drawer-sidebar-mount .nav-link svg { width: 1.3rem; height: 1.3rem; flex: 0 0 auto; }
  #shell-drawer-sidebar-mount .nav-link.active {
    border-color: rgb(255 82 128 / 0.48);
    background: linear-gradient(100deg, rgb(255 45 104 / 0.31), rgb(255 45 104 / 0.08));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
  }
}

/* One profile control everywhere: compact avatar circle, never a variable-
   width pill. Notifications and profile always remain inside the viewport. */
.shell-topright-bar .arena-profile-btn {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  justify-content: center;
  border-radius: 0.9rem;
}
.shell-topright-bar .arena-profile-copy,
.shell-topright-bar .arena-profile-btn > svg { display: none; }
.shell-topright-bar .arena-profile-avatar {
  width: 2.15rem;
  height: 2.15rem;
  flex-basis: 2.15rem;
}

@media (max-width: 1023px) {
  .shell-topright-bar {
    right: 0.7rem;
    max-width: 5.95rem;
    gap: 0.4rem;
  }
  .shell-topright-bar .arena-profile-wrap { display: block; }
  .shell-topright-bar .arena-notify-btn,
  .shell-topright-bar .arena-profile-btn {
    width: 2.65rem;
    min-width: 2.65rem;
    max-width: 2.65rem;
    height: 2.65rem;
  }
  .shell-topright-bar .arena-profile-avatar {
    width: 2.05rem;
    height: 2.05rem;
    flex-basis: 2.05rem;
  }
  .shell-topright-bar .arena-profile-dropdown {
    position: fixed;
    top: calc(3.65rem + env(safe-area-inset-top));
    right: 0.7rem;
  }
}

/* Final mobile utility width: two circles (bell + avatar), never clipped. */
@media (max-width: 1023px) {
  .shell-topright-bar {
    width: auto;
    max-width: 5.95rem;
    right: 0.7rem;
  }
  .shell-topright-bar .arena-profile-wrap { display: block; }
}

/* Desktop restores the complete identity pill. The compact avatar-only
   treatment above remains exclusive to the responsive application shell. */
@media (min-width: 1024px) {
  .shell-topright-bar { max-width: none; }
  .shell-topright-bar .arena-profile-btn {
    width: auto;
    min-width: 10.5rem;
    max-width: min(16rem, calc(100vw - 8rem));
    height: 2.9rem;
    padding: 0.3rem 0.8rem 0.3rem 0.35rem;
    justify-content: flex-start;
    gap: 0.65rem;
    border-radius: 999px;
  }
  .shell-topright-bar .arena-profile-copy {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
  }
  .shell-topright-bar .arena-profile-btn > svg { display: block; margin-left: auto; }
  .shell-topright-bar .arena-profile-avatar {
    width: 2.15rem;
    height: 2.15rem;
    flex-basis: 2.15rem;
  }
  .shell-sidebar .nav-link[href^="/contests.html"] { display: none !important; }
}

/* Floating mobile primary navigation */
.mobile-bottom-nav { display: none; }

@media (max-width: 1023px) {
  .shell-drawer,
  .mobile-drawer { display: none !important; }
  .shell-topbar .topbar-menu-btn,
  .mobile-topbar #drawer-open-btn { display: none !important; }
  .shell-topbar h1 { margin-left: 0; }

  .mobile-bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    z-index: 70;
    width: min(calc(100% - 1rem), 32rem);
    min-height: 4.35rem;
    padding: 0.38rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.2rem;
    border: 1px solid rgb(255 132 160 / 0.18);
    border-radius: 1.35rem;
    background: linear-gradient(145deg, rgb(54 2 20 / 0.94), rgb(24 0 8 / 0.96));
    box-shadow: 0 1rem 3.5rem rgb(0 0 0 / 0.48), inset 0 1px 0 rgb(255 255 255 / 0.045);
    backdrop-filter: blur(22px) saturate(145%);
    transform: translateX(-50%);
  }
  .mobile-bottom-link {
    position: relative;
    min-width: 0;
    min-height: 3.55rem;
    padding: 0.38rem 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    border-radius: 1rem;
    color: rgb(255 225 233 / 0.52);
    font-size: 0.62rem;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: color 0.12s ease, background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-bottom-link svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-bottom-link.active {
    color: #fff;
    background: linear-gradient(145deg, rgb(255 45 104 / 0.34), rgb(143 10 51 / 0.25));
    box-shadow: inset 0 0 0 1px rgb(255 96 137 / 0.18);
  }
  .mobile-bottom-create { color: #ff7da2; }
  .mobile-bottom-create svg {
    width: 1.7rem;
    height: 1.7rem;
    padding: 0.28rem;
    border-radius: 0.65rem;
    background: rgb(255 45 104 / 0.16);
  }
  .mobile-bottom-link .notif-icon-wrap { position: relative; }
  .mobile-bottom-link .nav-notif-badge { top: -0.45rem; right: -0.7rem; }

  .shell-main { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)) !important; }
  body.notification-drawer-open .mobile-bottom-nav,
  body.yap-call-window .mobile-bottom-nav,
  body.vibes-comments-open .mobile-bottom-nav,
  body:has(.vibes-active-wrap.comments-open) .mobile-bottom-nav { display: none; }
}

@media (max-width: 370px) {
  .mobile-bottom-nav { width: calc(100% - 0.6rem); bottom: max(0.3rem, env(safe-area-inset-bottom)); }
  .mobile-bottom-link { font-size: 0.57rem; }
}

/* Shared utility controls: fixed geometry prevents the notification/profile
   cluster from drifting or overflowing across pages. */
.shell-topright-bar {
  max-width: calc(100vw - 2rem);
}
.arena-profile-btn {
  height: 2.75rem;
  max-width: min(15rem, calc(100vw - 7rem));
  overflow: hidden;
  white-space: nowrap;
}
.arena-profile-avatar { flex: 0 0 2rem; }
.arena-profile-copy {
  flex: 1 1 auto;
  align-items: flex-start;
  overflow: hidden;
}
.arena-profile-copy strong,
.arena-profile-copy small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.arena-profile-btn > svg { flex: 0 0 auto; }
.arena-profile-dropdown {
  width: min(12rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
}

@media (max-width: 1023px) {
  .shell-topright-bar {
    top: calc(0.6rem + env(safe-area-inset-top));
    right: 0.75rem;
    max-width: 2.75rem;
  }
  .shell-topright-bar .arena-notify-btn {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
  }
}

@media (max-width: 1023px) {
  .shell-topright-bar {
    width: auto;
    max-width: 5.95rem;
    right: 0.7rem;
  }
  .shell-topright-bar .arena-profile-wrap { display: block; }
}
