/* AnimeLink V40: centralized environment map. All decorative layers are inert. */
:root {
  --nexus-bg-home: url("assets/nexus-environments/home-discover-world.jpg");
  --nexus-bg-chat: url("assets/nexus-environments/chat-rainy-street.webp");
  --nexus-bg-communities: url("assets/nexus-environments/community-torii.jpg");
  --nexus-bg-profile: url("assets/nexus-environments/profile-sakura-lake.webp");
  --nexus-bg-match: url("assets/nexus-environments/match-neon-bridge.webp");
  --nexus-bg-activity: url("assets/nexus-environments/activity-moon-torii.webp");
  --nexus-bg-create: url("assets/nexus-environments/create-community-stairs.webp");
  --nexus-bg-roleplay: url("assets/nexus-environments/gojo-energy-portal.webp");
  --nexus-bg-animecine: url("assets/nexus-environments/gojo-energy-portal.webp");
  --nexus-bg-nakama: url("assets/nexus-environments/mi-nakama-ship.webp");
  --nexus-accent: #ff2f72;
  --nexus-glow: #ff3d8c;
  --nexus-panel: rgba(7, 9, 22, .78);
  --nexus-border: rgba(255, 92, 157, .46);
  --nexus-overlay: rgba(4, 5, 14, .5);
}

#nexusV26.nx26 {
  --nexus-background: var(--nexus-bg-home);
  --nx: var(--nexus-accent);
  isolation: isolate;
  background-color: #070611 !important;
  background-image: linear-gradient(180deg, rgba(4, 5, 13, .12), rgba(4, 5, 13, .72)), var(--nexus-background) !important;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: scroll;
}

#nexusV26[data-page="feed"] { --nexus-background: var(--nexus-bg-home); background-size: min(100vw, 1536px) auto; }
#nexusV26[data-page="chats"][data-chat-wallpaper="default"] { --nexus-background: var(--nexus-bg-chat); }
#nexusV26[data-page="chats"][data-chat-wallpaper="home"] { --nexus-background: var(--nexus-bg-home); }
#nexusV26[data-page="chats"][data-chat-wallpaper="communities"] { --nexus-background: var(--nexus-bg-communities); }
#nexusV26[data-page="chats"][data-chat-wallpaper="profile"] { --nexus-background: var(--nexus-bg-profile); }
#nexusV26[data-page="chats"][data-chat-wallpaper="match"] { --nexus-background: var(--nexus-bg-match); }
#nexusV26[data-page="chats"][data-chat-wallpaper="custom"] { --nexus-background: var(--nexus-custom-chat-image, var(--nexus-bg-chat)); }
#nexusV26[data-page="communities"] { --nexus-background: var(--nexus-bg-communities); background-position: 50% 38%; }
#nexusV26[data-page="profile"] { --nexus-background: var(--nexus-bg-profile); background-position: 50% 45%; }
#nexusV26[data-page="match"] { --nexus-background: var(--nexus-bg-match); background-position: 50% 48%; }
#nexusV26[data-page="activity"] { --nexus-background: var(--nexus-bg-activity); background-position: 50% 40%; }

#nexusV26 .nx-shell,
#nexusV26 .nx-main,
#nexusV26 .nx-right { background-color: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#nexusV26 .nx-main { min-width: 0; filter: none !important; }
#nexusV26 .nx-petal-layer { z-index: 2; pointer-events: none !important; filter: none !important; }
#nexusV26 .nx-petal-layer *, #nexusV26 .nx-petal { pointer-events: none !important; }
#nexusV26 .nx-top { position: relative; z-index: 24; background: rgba(5, 6, 15, .55) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#nexusV26 .nx-nav { background: rgba(7, 7, 18, .94) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; filter: none !important; border-right: 1px solid var(--nexus-border) !important; }
#nexusV26 .nx-nav-title { background: rgba(7, 7, 18, .98) !important; }
#nexusV26 .nx-right { border-left-color: var(--nexus-border); }

/* The supplied Home art already includes its title: keep the live controls and avoid duplicate text. */
#nexusV26[data-page="feed"] .nx-social-hero-v268 {
  --hero: var(--nexus-bg-home) !important;
  min-height: clamp(230px, 32vw, 390px);
  max-height: none;
  border: 0;
  background: transparent !important;
  box-shadow: none;
}
#nexusV26[data-page="feed"] .nx-social-hero-v268 .nx-social-hero-overlay { min-height: inherit; justify-content: flex-end; background: transparent !important; }
#nexusV26[data-page="feed"] .nx-social-hero-overlay > span,
#nexusV26[data-page="feed"] .nx-social-hero-overlay > h1,
#nexusV26[data-page="feed"] .nx-social-hero-overlay > p { display: none !important; }
#nexusV26[data-page="feed"] .nx-social-hero-overlay .nx-hero-search,
#nexusV26[data-page="feed"] .nx-social-hero-overlay .nx-hero-primary { position: relative; z-index: 3; }

/* Section art lives on the Nexus canvas so it stays visible around the functional cards. */
#nexusV26[data-page="communities"] .nx-community-page-hero { --nx-scene: var(--nexus-bg-communities) !important; background: transparent !important; box-shadow: none; }
#nexusV26[data-page="chats"] .nx-chat-landing-hero { --nx-scene: var(--nexus-background) !important; background: transparent !important; box-shadow: none; }
#nexusV26 .nx-discover-card,
#nexusV26 .nx-card,
#nexusV26 .nx-conversation-row,
#nexusV26 .nx-right-card { background-color: var(--nexus-panel); border-color: var(--nexus-border); backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
#nexusV26 .nx-discover-card { box-shadow: 0 10px 28px rgba(1, 2, 9, .4), 0 0 18px rgba(255, 54, 125, .12); }

/* Community Nexus has its own persistent desktop sidebar and an independent mobile drawer. */
@media (min-width: 1200px) {
  #nexusV26 .nx-shell { display: grid !important; grid-template-columns: 238px minmax(0, 1fr) 258px !important; height: calc(100% - 68px) !important; min-height: 0; }
  #nexusV26 .nx-nav { display: flex !important; position: relative !important; inset: auto !important; grid-column: 1; width: auto !important; height: 100%; min-height: 0; overflow: auto; transform: none !important; visibility: visible !important; pointer-events: auto !important; z-index: 3; }
  #nexusV26 .nx-main { grid-column: 2; width: auto; min-width: 0; overflow-x: hidden; }
  #nexusV26 .nx-right { display: block !important; grid-column: 3; width: auto; min-width: 0; overflow: auto; }
  #nexusV26 .nx-menu-toggle { display: none !important; }
  #nexusV26[data-page="communities"] .nx-shell { grid-template-columns: 238px minmax(0, 1fr) !important; }
  #nexusV26[data-page="communities"] .nx-right { display: none !important; }
}
@media (min-width: 761px) and (max-width: 1199px) {
  #nexusV26 .nx-shell { display: grid !important; grid-template-columns: 218px minmax(0, 1fr) !important; height: calc(100% - 68px) !important; min-height: 0; }
  #nexusV26 .nx-nav { display: flex !important; position: relative !important; inset: auto !important; grid-column: 1; width: auto !important; height: 100%; min-height: 0; overflow: auto; transform: none !important; visibility: visible !important; pointer-events: auto !important; z-index: 3; }
  #nexusV26 .nx-main { grid-column: 2; width: auto; min-width: 0; overflow-x: hidden; }
  #nexusV26 .nx-right { display: none !important; }
  #nexusV26 .nx-menu-toggle { display: none !important; }
}
@media (max-width: 760px) {
  #nexusV26 .nx-top { height: 64px; min-height: 64px; z-index: 30; }
  #nexusV26 .nx-menu-toggle { display: inline-flex !important; position: relative; z-index: 32; }
  #nexusV26 .nx-shell { display: block !important; height: calc(100% - 64px) !important; min-width: 0; }
  #nexusV26 .nx-main { width: 100%; min-width: 0; padding: 10px 10px 100px !important; }
  #nexusV26 .nx-right { display: none !important; }
  #nexusV26 .nx-nav { position: fixed !important; inset: 64px auto 0 0 !important; display: flex !important; flex-direction: column; width: min(84vw, 310px) !important; max-width: calc(100vw - 48px); height: calc(100dvh - 64px) !important; max-height: calc(100vh - 64px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; transform: translateX(-105%) !important; visibility: hidden !important; pointer-events: none !important; transition: transform .22s ease, visibility .22s ease; z-index: 26; box-shadow: 16px 0 36px rgba(0,0,0,.5); }
  #nexusV26.nx-drawer-open .nx-nav, #nexusV26 .nx-nav.mobile-open { transform: translateX(0) !important; visibility: visible !important; pointer-events: auto !important; }
  #nexusV26 .nx-drawer-backdrop { position: fixed !important; inset: 64px 0 0 !important; display: block; opacity: 0; visibility: hidden; pointer-events: none !important; background: rgba(2,3,10,.58) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; z-index: 25; }
  #nexusV26.nx-drawer-open .nx-drawer-backdrop { opacity: 1; visibility: visible; pointer-events: auto !important; }
  #nexusV26.nx-drawer-open .nx-mobile-bottom { pointer-events: none !important; }
  #nexusV26 .nx-mobile-bottom { z-index: 24 !important; }
  #nexusV26[data-page="feed"] { background-size: 100% auto; background-position: center top; }
  #nexusV26[data-page="feed"] .nx-social-hero-v268 { min-height: 218px; margin: 0 -2px 10px; }
  #nexusV26[data-page="feed"] .nx-social-hero-v268 .nx-social-hero-overlay { padding: 10px; }
  #nexusV26[data-page="chats"] { background-position: center 47%; }
  #nexusV26[data-page="communities"] { background-position: center 40%; }
  #nexusV26[data-page="profile"] { background-position: center 38%; }
  #nexusV26[data-page="match"] { background-position: center center; }
  #nexusV26[data-page="activity"] { background-position: center 35%; }
}

#nexusV26[data-ambient-effect="sparkles"] .nx-petal,
#nexusV26[data-ambient-effect="calm"] .nx-petal { width: 7px; height: 7px; border-radius: 50%; clip-path: none !important; background: radial-gradient(circle, #fff 0 12%, #ff83d4 30%, rgba(101,150,255,.12) 75%) !important; box-shadow: 0 0 14px #ff6cd7a0; }
#nexusV26[data-ambient-effect="calm"] .nx-petal { width: 4px; height: 4px; opacity: .5; box-shadow: 0 0 10px #78bbff80; }
#nexusV26[data-ambient-effect="off"] .nx-petal-layer { display: none !important; }
.nx-wallpaper-row { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(170px, .8fr); gap: 10px; align-items: center; }
.nx-wallpaper-preview { grid-column: 1 / -1; width: 100%; min-height: 100px; border: 1px solid var(--nexus-border); border-radius: 14px; background-color: #080a18; background-position: center 48%; background-repeat: no-repeat; background-size: cover; box-shadow: inset 0 0 0 1000px rgba(2,4,12,.14); }
.nx-wallpaper-upload { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 42px; color: #e9e6f2; }
.nx-wallpaper-upload input { max-width: min(100%, 260px); color: #c8cad8; }
.nx-wallpaper-status { grid-column: 1 / -1; color: #aeb5c8; line-height: 1.45; }
.nx-wallpaper-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.nx-wallpaper-actions button { min-height: 42px; }

#nxCommunityModal .nx-modal-card { background-image: linear-gradient(90deg, rgba(5,6,15,.94), rgba(5,6,15,.8) 60%, rgba(5,6,15,.52)), var(--nexus-bg-create); background-size: cover; background-position: center 36%; }
#nxCommunityView .nx-rp { background: linear-gradient(180deg, rgba(5,6,15,.32), rgba(5,6,15,.82)), var(--nexus-bg-roleplay) center 28% / cover fixed; border-radius: 20px; }
#nxCommunityView .nx-rp-hero { min-height: 260px; background-image: linear-gradient(90deg, rgba(5,6,15,.95), rgba(5,6,15,.82) 45%, rgba(5,6,15,.16)), var(--nexus-bg-roleplay) !important; background-size: cover; background-position: 72% 28%; border-color: var(--nexus-border); }
@media (max-width: 760px) { #nxCommunityView .nx-rp { background-attachment: scroll; } #nxCommunityView .nx-rp-hero { background-position: 64% 20%; } }

/* AnimeCine remains the same V32 component. The Gojo image is limited to its landing hero. */
#ac32 .ac32-hero { background-image: linear-gradient(90deg, rgba(5,6,12,.95), rgba(5,6,12,.78) 48%, rgba(5,6,12,.12)), var(--nexus-bg-animecine) !important; background-position: center, 70% 28%; background-size: cover; border-color: var(--nexus-border); }
#ac32 .ac32-hero h1, #ac32 .ac32-hero p, #ac32 .ac32-hero small { text-shadow: 0 2px 10px rgba(0,0,0,.72); }

/* Mi Nakama keeps its selectable background: the ship is the unselected stage default. */
#nakamaView .nk21-page { background-image: linear-gradient(180deg, rgba(6,7,13,.66), rgba(6,7,13,.84)), var(--nexus-bg-nakama); background-size: cover; background-position: center 48%; background-attachment: fixed; border-radius: 20px; }
#nakamaView .nk21-stage { --nk21-bg: var(--nexus-bg-nakama); }
@media (max-width: 760px) { #nakamaView .nk21-page { background-attachment: scroll; background-position: center 44%; } }

@media (prefers-reduced-motion: reduce) {
  #nexusV26 .nx-petal { animation: none !important; display: none !important; }
  #nexusV26 .nx-nav { transition: none !important; }
}

/* V41: restore the reference-led Community Nexus canvas and the missing petal animation. */
:root {
  --nexus-text-primary: #f8f6ff;
  --nexus-text-secondary: #c0bfd1;
  --nexus-radius-card: 20px;
  --nexus-shadow-card: 0 14px 34px rgba(0, 0, 0, .38), 0 0 20px rgba(255, 46, 119, .12);
}

#nexusV26[data-page="communities"] {
  --nexus-background: var(--nexus-bg-communities);
  background-color: #080713 !important;
  background-image: linear-gradient(180deg, rgba(5, 5, 14, .08), rgba(5, 5, 14, .18) 48%, rgba(5, 5, 14, .48)), var(--nexus-bg-communities) !important;
  background-repeat: no-repeat !important;
  background-size: auto 100vh !important;
  background-position: 50% 38% !important;
  background-attachment: fixed !important;
}

#nexusV26[data-page="communities"] .nx-community-discover {
  width: 100%;
  max-width: 1420px;
  margin-inline: auto;
  padding-bottom: max(34px, env(safe-area-inset-bottom));
}

#nexusV26[data-page="communities"] .nx-community-page-hero {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 16 / 9;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 0 24px 24px;
  background: var(--nexus-bg-home) center / 100% 100% no-repeat !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .26) !important;
  overflow: hidden;
}

#nexusV26[data-page="communities"] .nx-discover-hero-copy {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

#nexusV26[data-page="communities"] .nx-discover-search-row .nx-community-search,
#nexusV26[data-page="communities"] .nx-discover-filter-button,
#nexusV26[data-page="communities"] .nx-discover-chip {
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

#nexusV26[data-page="communities"] .nx-discover-search-row .nx-community-search {
  background: rgba(5, 8, 23, .69);
  border-color: rgba(255, 130, 190, .56);
  box-shadow: inset 0 0 18px rgba(15, 20, 43, .5), 0 0 18px rgba(255, 47, 122, .19);
}

#nexusV26[data-page="communities"] .nx-discover-filter-button {
  background: rgba(7, 10, 25, .76);
  border-color: rgba(228, 119, 187, .66);
}

#nexusV26[data-page="communities"] .nx-discover-chip {
  background: rgba(7, 10, 25, .67);
  border-color: rgba(214, 216, 238, .3);
}

#nexusV26[data-page="communities"] .nx-discover-card {
  border-radius: var(--nexus-radius-card);
  border-color: rgba(255, 85, 153, .62);
  background: rgba(7, 9, 22, .68) !important;
  box-shadow: var(--nexus-shadow-card);
  backdrop-filter: blur(9px) !important;
  -webkit-backdrop-filter: blur(9px) !important;
}

#nexusV26[data-page="communities"] .nx-discover-empty,
#nexusV26[data-page="communities"] .nx-trending-empty {
  color: var(--nexus-text-primary);
  background: rgba(7, 9, 22, .72);
  border-color: rgba(255, 85, 153, .48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#nexusV26[data-page="communities"] .nx-discover-section-title h2 {
  color: var(--nexus-text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .78);
}

#nexusV26[data-page="communities"] .nx-sakura-event {
  box-shadow: var(--nexus-shadow-card);
}

#nexusV26 .nx-drawer-backdrop {
  display: none;
  padding: 0;
  border: 0;
}

#nexusV26 .nx-petal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  overflow: hidden;
  contain: layout paint style;
  pointer-events: none !important;
}

#nexusV26 .nx-petal {
  position: absolute;
  top: -5vh;
  left: var(--x);
  width: var(--size, 13px);
  height: calc(var(--size, 13px) * .7);
  border-radius: 90% 8% 90% 8%;
  opacity: 0;
  background: linear-gradient(145deg, #fff2f9 0%, #ff91c4 48%, #ec327c 100%);
  box-shadow: 0 0 8px rgba(255, 121, 181, .46);
  filter: blur(var(--softness, 0px));
  transform: translate3d(0, -8vh, 0) rotate(0deg);
  animation: nxV41PetalFall var(--duration, 11s) linear var(--delay, 0s) both;
  will-change: transform, opacity;
  pointer-events: none !important;
}

@keyframes nxV41PetalFall {
  0% { opacity: 0; transform: translate3d(0, -8vh, 0) rotate(0deg); }
  10% { opacity: var(--petal-opacity, .82); }
  48% { transform: translate3d(var(--drift-mid), 52vh, 0) rotate(var(--turn-mid)); }
  100% { opacity: 0; transform: translate3d(var(--drift), 112vh, 0) rotate(var(--turn)); }
}

/* AnimeCine keeps its existing player and room views; this only makes their shell responsive. */
#ac32.open { align-items: stretch; overflow: hidden; }
#ac32 .ac32-side { flex: 0 0 250px; min-width: 0; }
#ac32 .ac32-app { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
#ac32 #ac32Main { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#ac32 .ac32-page, #ac32 .ac32-room-page { width: 100%; max-width: 1200px; min-width: 0; margin-inline: auto; }
#ac32 .ac32-grid, #ac32 .ac32-wide { min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
#ac32 .ac32-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#ac32 .ac32-friends, #ac32 .ac32-schedule { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#ac32 .ac32-card { min-width: 0; }
#ac32 .ac32-card .pic { background-size: cover; background-position: center; }
#ac32 .ac32-player-frame { width: 100%; }
#ac32 .ac32-hero { min-width: 0; min-height: clamp(280px, 30vw, 440px); }
#ac32 .ac32-hero {
  background-size: 100% 100%, auto 100% !important;
  background-position: center, right 28% !important;
  background-repeat: no-repeat !important;
}
#ac32 .ac32-hero aside { position: relative; z-index: 1; align-self: flex-end; padding: 10px 12px; border-radius: 14px; background: rgba(5, 6, 12, .63); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

@media (min-width: 901px) and (max-width: 1279px) {
  #ac32 .ac32-grid, #ac32 .ac32-wide, #ac32 .ac32-friends, #ac32 .ac32-schedule { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #ac32 .ac32-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #ac32 .ac32-app > header { padding-inline: 14px; }
  #ac32 #ac32Main { padding-inline: 16px; }
}

@media (min-width: 768px) {
  #nexusV26[data-page="communities"] .nx-discover-trending { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
}

@media (min-width: 768px) and (max-width: 1100px) {
  #nexusV26[data-page="communities"] .nx-discover-featured { gap: 9px; }
  #nexusV26[data-page="communities"] .nx-discover-cover { height: 150px; }
  #nexusV26[data-page="communities"] .nx-discover-card-body { padding-inline: 10px; }
  #nexusV26[data-page="communities"] .nx-discover-trending { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  #ac32 .ac32-grid, #ac32 .ac32-wide, #ac32 .ac32-friends, #ac32 .ac32-schedule { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  #nexusV26[data-page="communities"] {
    background-size: auto 100dvh !important;
    background-position: 50% 38% !important;
  }
  #nexusV26[data-page="communities"] .nx-community-page-hero {
    width: auto;
    aspect-ratio: 16 / 9;
    margin: 0 -10px 10px !important;
    border-radius: 0 0 20px 20px;
  }
  #nexusV26[data-page="communities"] .nx-drawer-backdrop {
    display: block;
    inset: 64px 0 0 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transition: opacity .2s ease, visibility .2s ease;
  }
  #nexusV26[data-page="communities"].nx-drawer-open .nx-drawer-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
  }
  #nexusV26[data-page="communities"] .nx-nav {
    top: 64px !important;
    bottom: 0 !important;
    height: calc(100dvh - 64px) !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
  }
  #nexusV26[data-page="communities"] .nx-discover-trending { grid-template-columns: none; grid-auto-columns: 105px; grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; }
  #nexusV26[data-page="communities"] .nx-discover-card { backdrop-filter: blur(6px) !important; -webkit-backdrop-filter: blur(6px) !important; }
}

@media (min-width: 768px) and (orientation: portrait) {
  #nexusV26[data-page="communities"] { background-size: auto 100dvh !important; background-position: 50% 38% !important; }
}

@media (max-width: 900px) {
  #ac32 .ac32-side {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(270px, 84vw) !important;
    max-width: calc(100vw - 48px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 4 !important;
  }
  #ac32.side-open .ac32-side { left: 0 !important; transform: translateX(0); }
  #ac32 .ac32-overlay {
    position: fixed !important;
    inset: 0 !important;
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
    z-index: 3 !important;
  }
  #ac32.side-open .ac32-overlay { visibility: visible; opacity: 1; pointer-events: auto; }
  #ac32 .ac32-app { position: relative; z-index: 1; width: 100%; }
  #ac32 .ac32-hero { min-height: 270px; }
}

@media (max-width: 767px) {
  #ac32 .ac32-grid, #ac32 .ac32-wide, #ac32 .ac32-friends, #ac32 .ac32-schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #ac32 .ac32-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #ac32 .ac32-app > header { flex-wrap: nowrap; min-width: 0; }
  #ac32 .ac32-hero { min-height: 250px; background-position: center, right 24% !important; }
  #ac32 .ac32-hero aside { display: none; }
  #ac32 .ac32-player-frame { aspect-ratio: 16 / 9; max-height: none; }
}

@media (max-width: 380px) {
  #ac32 .ac32-grid, #ac32 .ac32-wide { grid-template-columns: minmax(0, 1fr); }
  #ac32 .ac32-quick { grid-template-columns: minmax(0, 1fr); }
  #nexusV26[data-page="communities"] .nx-discover-category-row { gap: 6px; }
  #nexusV26[data-page="communities"] .nx-discover-chip { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #nexusV26 .nx-petal-layer { display: none !important; }
  #ac32 .ac32-side, #ac32 .ac32-overlay { transition: none !important; }
}

/* V42 corrections from the V41 delivery audit. */
#nexusV26[data-page="events"] .nx-main { min-width: 0; }
.nx-events-hero { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:24px; border:1px solid var(--nexus-border); border-radius:20px; background:linear-gradient(90deg,rgba(5,6,15,.91),rgba(5,6,15,.48)),var(--nexus-bg-activity) center 42%/cover; box-shadow:var(--nexus-shadow-card); }
.nx-events-hero h1 { margin:.25em 0; font-size:clamp(25px,3vw,40px); }
.nx-events-hero p { color:var(--nexus-text-secondary); }
.nx-events-page { display:grid; gap:14px; max-width:1200px; margin-inline:auto; }
.nx-event-card { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:14px; padding:16px; border:1px solid var(--nexus-border); border-radius:16px; }
.nx-event-date { display:grid; place-items:center; width:64px; height:68px; border-radius:14px; background:linear-gradient(145deg,#ff2f72,#9b123c); color:#fff; }
.nx-event-date b { font-size:24px; line-height:1; }
.nx-event-date small { text-transform:uppercase; }
.nx-event-copy h3 { margin:3px 0; }
.nx-event-copy p,.nx-event-copy time { color:var(--nexus-text-secondary); }
.nx-event-copy>small { color:#ff8fba; letter-spacing:.08em; }
.nx-event-copy p { margin:4px 0; }
@media(max-width:767px){.nx-events-hero{align-items:flex-start;flex-direction:column;padding:18px}.nx-event-card{grid-template-columns:54px minmax(0,1fr);gap:10px;padding:11px}.nx-event-date{width:50px;height:58px}.nx-event-date b{font-size:20px}}
@media(max-width:900px){#ac32 .ac32-close-menu{display:block;width:100%;min-height:42px;margin:4px 0 10px;padding:10px 12px;border:1px solid #363944;border-radius:10px;background:#11131a;color:#fff;text-align:left}#ac32.side-open .ac32-side{overscroll-behavior:contain;touch-action:pan-y;z-index:5!important}#ac32.side-open .ac32-overlay{z-index:4!important}#ac32 .ac32-bottom{position:fixed!important;left:0;right:0;bottom:0;padding-bottom:calc(5px + env(safe-area-inset-bottom));z-index:2}#ac32 #ac32Main{padding-bottom:calc(104px + env(safe-area-inset-bottom))}#ac32 .ac32-room-layout{display:flex;flex-direction:column}#ac32 .ac32-room-chat{max-height:42dvh}}
@media(min-width:901px){#ac32 .ac32-close-menu{display:none}#ac32 .ac32-room-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,340px);gap:18px;align-items:start}#ac32 .ac32-room-chat{position:sticky;top:12px}}
#ac32 .ac32-room-chat{min-width:0;border:1px solid var(--nexus-border);border-radius:16px;background:rgba(7,9,22,.84);padding:12px;display:flex;flex-direction:column;max-height:min(68vh,720px)}
#ac32 .ac32-room-chat h2{margin:0 0 8px;font-size:17px}
#ac32 .ac32-room-messages{min-height:100px;overflow:auto;overscroll-behavior:contain;flex:1;display:flex;flex-direction:column;gap:9px}
#ac32 .ac32-room-messages article{padding:8px 10px;border-radius:12px;background:rgba(255,255,255,.055);overflow-wrap:anywhere}
#ac32 .ac32-room-messages article p{margin:3px 0}
#ac32 .ac32-room-messages article small{color:#9da4b4}
#ac32 #ac32RoomChatForm{display:flex;gap:7px;margin-top:10px}
#ac32 #ac32RoomChatInput{flex:1;min-width:0;border:1px solid #444857;border-radius:10px;padding:10px;background:#101321;color:#fff}
#ac32 #ac32RoomChatForm button,#ac32 .ac32-favorite{border:1px solid var(--nexus-border);border-radius:10px;padding:10px 14px;background:#f51f40;color:#fff;cursor:pointer}
#ac32 .ac32-favorite{margin-top:12px}


/* V42.2: show the selected artwork through the live content and normalize the Nexus drawer across phones/tablets. */
:root {
  --nexus-bg-tree: url("assets/nexus-environments/community-tree-lights.webp");
  --nexus-bg-coast: url("assets/nexus-environments/wallpaper-coast-pink.webp");
  --nexus-bg-meadow: url("assets/nexus-environments/wallpaper-flower-meadow.webp");
  --nexus-bg-fuji: url("assets/nexus-environments/wallpaper-fuji-sakura.webp");
  --nexus-bg-mitsuri: url("assets/nexus-environments/anime-mitsuri-cover.webp");
}
#nexusV26.nx26 { background-size: cover !important; background-position: center top; }
#nexusV26 .nx-main { background: transparent !important; background-image: none !important; }
#nexusV26[data-page="feed"] { background-size: cover !important; background-position: center 24% !important; }
#nexusV26[data-page="communities"] { background-size: cover !important; background-position: center 30% !important; background-attachment: scroll !important; }
#nexusV26[data-page="chats"][data-chat-wallpaper="tree"] { --nexus-background: var(--nexus-bg-tree); }
#nexusV26[data-page="chats"][data-chat-wallpaper="coast"] { --nexus-background: var(--nexus-bg-coast); }
#nexusV26[data-page="chats"][data-chat-wallpaper="meadow"] { --nexus-background: var(--nexus-bg-meadow); }
#nexusV26[data-page="chats"][data-chat-wallpaper="fuji"] { --nexus-background: var(--nexus-bg-fuji); }
#nexusV26[data-page="chats"] { background-size: cover !important; background-attachment: scroll !important; }
#nexusV26[data-page="feed"] .nx-social-hero-v268 {
  background-color: transparent !important;
  background-image: linear-gradient(180deg, transparent 72%, rgba(4,5,13,.18)), var(--nexus-bg-home) !important;
  background-size: cover !important;
  background-position: center 38% !important;
}
#nexusV26[data-page="feed"] .nx-social-hero-v268 .nx-social-hero-overlay { background: transparent !important; }
#nexusV26[data-page="communities"] .nx-community-page-hero {
  background-image: var(--nexus-bg-home) !important;
  background-size: cover !important;
  background-position: center 38% !important;
}
@media (max-width: 767px) {
  #nexusV26 .nx-menu-toggle { display: inline-flex !important; }
  #nexusV26 .nx-shell { display: block !important; }
  #nexusV26 .nx-shell { height: calc(100dvh - 64px) !important; }
  #nexusV26.open .nx-mobile-bottom {
    display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 11500 !important;
    min-height: 68px; padding: 6px max(7px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  }
  #nexusV26 .nx-nav {
    position: fixed !important; inset: 64px auto 0 0 !important;
    width: min(310px, 84vw) !important; max-width: calc(100vw - 48px) !important;
    height: auto !important; max-height: none !important;
    overflow-x: hidden !important; overflow-y: auto !important;
    overscroll-behavior: contain !important; touch-action: pan-y;
    transform: translateX(-105%) !important; visibility: hidden !important;
    pointer-events: none !important; z-index: 11520 !important;
    padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
    transition: transform .22s ease, visibility .22s ease !important;
  }
  #nexusV26.nx-drawer-open .nx-nav, #nexusV26 .nx-nav.mobile-open {
    transform: translateX(0) !important; visibility: visible !important; pointer-events: auto !important;
  }
  #nexusV26 .nx-drawer-backdrop {
    position: fixed !important; inset: 64px 0 0 !important; display: block !important;
    opacity: 0; visibility: hidden; pointer-events: none !important; z-index: 11510 !important;
    background: rgba(2,3,10,.62) !important; backdrop-filter: none !important;
  }
  #nexusV26.nx-drawer-open .nx-drawer-backdrop { opacity: 1; visibility: visible; pointer-events: auto !important; }
  #nexusV26.nx-drawer-open .nx-mobile-bottom { pointer-events: none !important; }
  #nexusV26[data-page="communities"] .nx-community-page-hero { background-position: 52% 38% !important; }
}
@media (min-width: 768px) {
  #nexusV26 .nx-nav { position: relative; }
  #nexusV26 .nx-drawer-backdrop { display: none !important; }
}
